HTTP Error 401.3 for specific .pdf file - http

I just uploaded two .pdf files on my server. They are both in the same folder.
The first one can be normally accessed but for the second one I get an
HTTP Error 401.3 "You are not authorized to view this page"
This looks weird to me. Do you have any idea why is this happening?

check filesystem permission if you are running linux. the user running the webserver should have read permission on both files you can do this with most ftp software or if you have shell access chmod a+r /path/to/your/file.pdf
if that does not solve the problem look for error in log file usually /var/log/apache/error.log

Related

Unable to find template in prod

I just uploaded my application to my webspace, and cleared the cache via ssh. But in the prod environment my log file shows me an exception:
InvalidArgumentException: Unable to find template "Project:News:overview.html.twig". (uncaught exception) at /path/to/my/project/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php line 123
Do you have any ideas what I can do?
In most cases the problem is, that windows is not case sensitive and linux is. So check your files and the case sensitivity of your files and folders.

Downloading file using webclient results in "Access to the path denied is denied"

i have button, on a click of which i want to download the file on the local pc, i am using webclient.downloadfile(), but i am getting the below error:
Access to the path 'C:\Windows\SysWOW64\inetsrv\ms-banner.gif' is denied.
i am using below code to download file:
WebClient client = new WebClient();
client.DownloadFile(new Uri("http://www.contoso.com/library/homepage/images/ms-banner.gif"), "ms-banner.gif");
i dont understand why its fetching the file from local server, as i have already stated the remote uri
It's fetching the file from the remote server but trying to save it in the current directory because you have only specified a relative filename as second argument: "ms-banner.gif". And it seems that the account you are running your application under doesn't have permission to write to the current working directory which happens to be C:\Windows\SysWOW64\inetsrv.
So you have basically 2 possibilities:
Modify the account you are running your application under and grant it permissions to write to this directory
Specify another location (as an absolute path) to save the file to where the account you are running your application under has write permissions.
contoso.com redirects to microsoft.com... the path you have there in the URL does not exist and you won't be able to download it. I'm not sure why it's trying to go to your local machine, but have you tried some other image on some other website? Like http://i.cdn.turner.com/cnn/.e/img/3.0/global/header/hdr-main.gif for example?

Server wordpress permissions

please be gentle as my server knowledge is next to none!
I've been asked to make some CSS changes to a wordpress site - fine, I'm good at that! I have all the ftp info and the wordpress passwords, but as I edit files and try and re-upload them using Dream Weaver I get an error that I don't have permission to write to the particular file. So, the first thing I thought to do is right click the file and edit permissions, but as I try and do this I get the same problem of:
An FTP error occurred - cannot put the_file.js. Access denied.
The file may not exist, or there could be a permission problem.
Make sure you have proper authorization on the server and the server is properly configured.
File activity incomplete. 1 file(s) or folder(s) were not completed.
Files with errors: 1
So, my question is - by knowing the ftp details is there any way I can change the permissions, or is it something to do with server configuration that I have no control over? Many thanks
This means that the FTP username you were provided does not have permission to modify files. YOu won't be able to reset the permissions either. You should contact the server admin and have them grant your user account the appropriate permissions to modify files.

wordpress error

i completed my client site in wordpress,then i uploaded this site into client server(FTP) but site is not going to open
this error is occur
"
Warning: fopen(piecemakerXML.xml) [function.fopen]: failed to open stream: Permission denied in F:\inetpub\vhosts\kni.com.my\httpdocs\wp-content\themes\twentyten\header.php on line 133
can't open file"
It's a file system permissions problem. WordPress does not have permission to access that file or the folder it's in. You'll have to change that. Most FTP programs have a CHMOD command built in, or you can shell in to the server, or use the hosting control panel.
Check the permissions of the file to ensure it is at least readable by the owner. And if you also want to write to it, it should be writable
Check out the page on Wordpress about file permissions. It has a pretty good list of example permissions
http://codex.wordpress.org/Changing_File_Permissions
Also Check out wikipedia
And to Change file permissions, do what #Dan said in his answer.

Spin off a command line process from an ASP.NET page

I have a web page hosted on the server and a zip file on the server's file system. The page is spinning off the 7zip process with some arguments (location of the zip file and destination folder for unzipping) but it seems to raise permission issues, of course. For each file in the archive I get "Can not open file [filename]". I tried windows authentication and running the process with a username and password but nothing worked properly. What would be the best way for unzipping the file on the server from security point of view? Ideally, I would also like to have this event driven so the file is unzipped as soon as it arrives on the server (this is when I request the page). Other solutions are welcome but simplicity/lightweight solution is preferred.
Thanks
Use one of an open or closed source zip library
e.g.:
http://dotnetzip.codeplex.com/ or
http://www.sharpdevelop.net/OpenSource/SharpZipLib/

Resources