Getting "Access to the path is denied" using ASP.net AjaxFileUpload - asp.net

I have a page using the AjaxFileUpload from the AJAX Control Toolkit. The process works fine on my local machine in Visual Studio. However when I publish it to the server the control is displaying Error after it's uploaded.
Using the Chrome F12 Developer Tools the failed network call is returning Access to the path is denied.
The file is being uploaded to the windows\temp folder, so the issue is when the file is copied from there to the the target uploads directly. The C# code is
AjaxFileUploader.SaveAs(Server.MapPath("~/Uploads/" + e.FileName));
As the developer I don't have access to the server, so I'm speaking to our support to resolve this. I've been told that all the permissions are correct (?).
Is there something in my code that's the issue? If not, what specific permissions that could be missing that I can suggest be checked/changed?
Thanks,
Kevin

I would check to ensure the NetworkService on the server has READ/WRITE permissions to the appropriate folders. Also, as good measure, check to insure the application pool your using has the same access as well.

Related

Support with hosting an ASP.NET application from my PC at work using IIS Express

I'm fairly new to developing with ASP.NET and in general. I have created a simple data-driven web application that will be used to display images the colors of which will be changed depending on certain criteria. I used Visual Studio 2019 to create it. When I test/run it from within VS 2019 using the "play" button, it runs perfectly and the page opens in my browser just as you would expect.
My issue is that I'm trying to deploy it to the IIS and host it from my machine here at work, so others can access the pages. I have published the application to a local file on my C:\ drive. I then open up IIS Manager and create the website by pointing to that local file. Now, when I choose to browse that site from the IIS manager, at first I was getting an error saying that access is denied.
Then I followed the instructions to configure the security on that local file folder to allow IIS_USRS to access the file, but when I run it, I just get a page that tries to load indefinitely.
What am I doing wrong? If I point the IIS Manager to the files after saving them to a location on my company's network, I again get the access is denied error.
Do I understand it correctly that IIS needs permission to access the files? If so, how do I configure it that way other than what I already tried? If I need to provide further information, please let me know. Thanks so much for your support.

HTTP Error 500.19 - Internal Server Error 0x80070003 Cannot read configuration file

I'm getting the above error when I publish my application and move it from development to production server. Below are the error details.
Detailed Error Information
Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x80070003
Config Error Cannot read configuration file
Config File \?\C:\inetpub\wwwroot\WorkmenCompTest\web.config
Requested URL http://localhost:80/wictest
Physical Path C:\inetpub\wwwroot\WorkmenCompTest
Logon Method Not yet determined
Logon User Not yet determined
This website used to work previously but recently the published version stopped working due to this error. As far as I can tell, the only change was installing iTextSharp and iTextSharp xmlworker through nuget.
I have tried, without success:
giving modify permission on the site folder to Everyone
checking the web.config file, and using an older version of the web.config file (from when the site worked).
uninstalling iTextSharp and iTextSharp XMLWorker
The project still runs without issue from Visual Studio.
This is solved. The error was caused by the folder name not matching the path for the virtual directory. Oh wow I feel dumb.
Check the applicationhost.config file under - .vs\lpsWeb-UI\config folder of your application root.
Under sites section of the config file check what the physical path points to.
If you modify those you should be able to fix the issue.
This is because of different physical path in the IIS.To change the physical path of application content
You can perform this procedure by using the user interface (UI), by running Appcmd.exe commands in a command-line window, by editing configuration files directly, or by writing WMI scripts.
User Interface
To use the UI
Open IIS Manager. For information about opening IIS Manager, see Open IIS Manager (IIS 7).
In the Connections pane, expand the Sites node and click to select the site in which your application runs.
In the Actions pane, click View Applications.
On the Applications feature page, select an application from the list and then click Basic Settings in the Actions pane.
In the Physical path box, change the path of the application content.
Click OK.
DefaultAppPool application pool runs under the Network Service account. This account is local to the computer and this account does not exist on another computer. Make sure that you configure the DefaultAppPool application pool to use an account that is a domain user. Then, you can use the same account on the WorkmenComp file server. Alternatively, you can create a workgroup account on the WorkmenComp file server.
I am getting this HTTP Error 500.19 error when I am giving physical path as Z:\App_Live in IIS
Instead of using z:\ ,
I used network path \\server\share\live_folder in the IIS physical path – something like this \\server\share\wwwroot\inetpub\wwwroot
Also you may need to specify username/password in "connect as".

ASP.NET Access to path '\\xxxx' is denied

I know this has come up in other questions, but none seem as simple:
I have a UNC share on another machine, with security set to Full Control for Everyone. If I log into my web server, I can access this share.
However when I try to access it using Directory.GetFiles(path) in the ASP.NET code, it returns an Access to the path \\xxxx is denied. error.
Also oddly, when I run the same website from my local visual studio web server, but pointing at the same path, the directory can be accessed fine.
What am i missing here?!
Add IUSR, IIS_IUSRS as suggested by Carlos487 and Network Service as well with full control on the directory that you are trying to access with your application. Hope this helps.

Unable to add ' ' to the Web site. Access is denied (550)

When I try to publish the project through visual studio I get the "Access is denied (550)" after googling the error I come to know that the issue is with ftp permission as it is read-only. But I am not able to see a permission property with read only in Visual Studio and unchecking it in order to give it full permission.
this sounds like a setting on the FTP site itself, not a Visual Studio issue. The FTP account you are using probably does not allow you to write to it.
I like to publish to a directory on my computer and then work with my Systems Admin to determine the best way of getting the data to the server (e.g., he gives me access via both allow-write FTP accounts and remote desktop.). Then I just physically move the files.
You'll have to give write permission in your FTP folder to the user you're using while deploying your app.
A more complete answer with step by step checking can be seen here: http://forums.asp.net/post/3966123.aspx
I had the same problem. Solved by ensuring that when you Publish>Connection, that the Passive Mode box is checked. Issue resolved

Upload vCard (.vcf) file to IIS7 Site

I'm trying to upload a vcard file to a site i've built with ASP.NET. It's hosted on an IIS7 server.
I keep running into the "content type not allowed" error when i try to upload the file. I have write permission to the directory, I've already added the MIME type for vcards and restarted the IIS server, however it still refuses to take it.
I'm using DevExpress UploadControl and i've removed any validation from it so i am fairly certain the control is not restricting the file upload.
Any other suggestions ?
Maybe your component just allow some content types by default and new ones must be granted access manually.
Can you to debug your server side code, to see if your page code executes and to spot exactly what component are throwing up that error?
It's an HTTP error or a .net exception?

Resources