I want to upload files to the shared folder iis virtual folder

Veysel COŞAR 20 Reputation points
2024-06-26T08:39:04.4266667+00:00

I want to upload files to shared folder via iis server. I can read the file with virtual folder. What kind of editing should be done on iis to upload the file?

Can you write sample software code to upload files?

Internet Information Services
0 comments No comments
{count} votes

Accepted answer
  1. XuDong Peng-MSFT 10,756 Reputation points Microsoft Vendor
    2024-06-27T09:08:01.69+00:00

    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:

    1. Right click the website and click Add Virtual Directory User's image
    2. Enter your shared folder path in the Physical Path input box, something like this image
    3. Set up authentication to enable anonymous authentication and specify the application pool identity. User's image
    4. Assigne the iis_iusrs and iusr 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:

    1. In ASP.NET WebForms, you can use the FileUpload control to implement your requirement, just refer to this doc: FileUpload control - Examples.
    2. In ASP.NET MVC/Core, usually you use form submission to upload files, you need to make sure the enctype property value is multipart/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.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.