Hi
What kind of editing should be done on iis to upload the file?
Try adding the shared folder to the site's virtual directory, which should meet your needs. Refer to the following steps:
- Right click the website and click
Add Virtual Directory
- Enter your shared folder path in the
Physical Path
input box, something like this - Set up authentication to enable anonymous authentication and specify the application pool identity.
- Assigne the
iis_iusrs
andiusr
permission to the shared folder.
You can try access your shared folder in browser with your site bindings/virtual directory name, something like: www.myapp.com\test
.
Can you write sample software code to upload files?
I'm afraid I can't give you specific code, it depends on your project type, for example:
- In ASP.NET WebForms, you can use the FileUpload control to implement your requirement, just refer to this doc: FileUpload control - Examples.
- In ASP.NET MVC/Core, usually you use form submission to upload files, you need to make sure the
enctype
property value ismultipart/form-data
to allow file upload. Mayby you can refer to the simple in Core tutorial:Upload files in ASP.NET Core.
If the answer is the right solution, please click "Accept Answer" and kindly upvote. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.