Uploading images for forum posts (/userfiles/*)

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
4/7/2011 3:42:09 AM
Gravatar
Total Posts 30

Uploading images for forum posts (/userfiles/*)

Hi

I let the users of my website upload images so they can add pictures to their forum posts. Uploading a picture works, but the newly created file in the userfiles subfolder of the site has weird permissions. It seems that MojoPortal somehow specifies permissions to use when creating the file. In my case this means that the IIS account has no permission to access the uploaded file.

The userfiles folder itself has correct permissions and permission inheritance to child folders is enabled.

When I manually create a new subfolder and file in the userfiles folder IIS can access the file. The problem occurs only when uploading/creating files via "File Browser".

IIS uses it's own account and a special app pool for this site.

Cheers,
Simon

4/7/2011 9:14:31 AM
Gravatar
Total Posts 18439

Re: Uploading images for forum posts (/userfiles/*)

Make sure the App_Data folder is writable by the web process. If it is not then the temporary location for uploads is under Windows/temp and this causes funky permissions on the files. If App_Data is writable it should write there for temporary files and then permissions should be ok after the file is moved.

Also make sure on your folder permissions that is is configured for permissions to propagate to child objects, if not then uploaded files may not inherit the         correct permissions from the folder.

Hope it helps,

Joe

4/8/2011 5:08:56 AM
Gravatar
Total Posts 30

Re: Uploading images for forum posts (/userfiles/*)

Great, that did the job. It would be nice if the Security Advisor would warn about this or if MojoPortal broke completely if the permissions aren't set correctly.

Thanks for the help and have a nice weekend!
Simon

You must sign in to post in the forums. This thread is closed to new posts.