简体   繁体   中英

IIS asp.net 4.0, upload to server / user rights to write

On my asp.net 4.0 site I have a upload function which allow a user to upload a document to the server.

The uploaded document is stored in a folder named c:\\uploads\\ and I store a reference to it in mysql db. It works well on my local development machine but not on the remote server. The remote server is a windows 2008 R2 running IIS.

I am suspecting that this has something to do with limited rights, so my question is:

Who should I give rights to write to that folder?

Look at the identity of the application pool in which the application is running. Likely it is the "Network Service" account. I supposed you'd grant read/write permissions.

You may want to consider an alternative approach that involves storing the bytes of the uploaded files in the mysql database itself. This is quite dated but relays the general approach. http://onlamp.com/pub/a/php/2000/09/15/php_mysql.html

The latter method has always been preferable to me from a security standpoint.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM