401 Error on files uploaded via file browser

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.
8/13/2013 3:04:03 PM
Gravatar
Total Posts 49
TRIAD/Next Level Interactive

401 Error on files uploaded via file browser

Hi Joe ---

We have a site that is throwing an error message when we try to access files (pdfs, images, etc) that we upload via the editor's file browser (using either the link or image icon in the toolbar). The files show up in the folder listing, but will return the following message when trying to access:

"401 - Unauthorized: Access is denied due to invalid credentials.
You do not have permission to view this directory or page using the credentials that you supplied."

If I upload directly using the "File Manager" (instead of via the editor) everything works.

Any idea what could be causing this?

 

mojoPortal Version: 2.3.5.8 MSSQL
Operating System: Microsoft Windows NT 6.1.7601 Service Pack 1
ASP.NET Info: v2.0.50727 Running in Full Trust

 

8/13/2013 3:11:20 PM
Gravatar
Total Posts 18439

Re: 401 Error on files uploaded via file browser

That would have to be coming from IIS not mojoPortal and probably caused by actual file permissions in the file system.

ie the user that is the identity on the app pool does not have read permission on the file.

Sometimes file permissions can get funky especially if you have moved or copied files from one machine to another.

If you upload directly the file gets new permissions based on being uploaded, but existing files have funky permissions. I suspect it works just fine for new files uploaded in the editor.

8/13/2013 3:16:28 PM
Gravatar
Total Posts 49
TRIAD/Next Level Interactive

Re: 401 Error on files uploaded via file browser

Actually... it's the reverse. Old files work just fine, but new ones get the error message. And you're absolutely right on... this site was transferred from one machine to another a few years ago. This may be the first time we're uploading since the move.

We'll check IIS. Thanks, as always, for the quick feedback!

8/14/2013 11:43:29 AM
Gravatar
Total Posts 49
TRIAD/Next Level Interactive

Re: 401 Error on files uploaded via file browser

We've been doing a little IIS investigation. Here's what we found:

Our IIS user does have full permission to read, list & read/execute anything in our "data/sites/1" directory.

However, whenever we upload pdfs/images via the editor tools and then check the permissions on those files at the server level... they have only been assigned "Special Permissions" for our IIS user... instead of read/write/etc.

Any idea why it would be locking files that we upload via the editor? It doesn't do this when we use the stand-alone mojoPortal File Manager.

8/15/2013 11:51:13 AM
Gravatar
Total Posts 18439

Re: 401 Error on files uploaded via file browser

There is nothing mojoPortal code can do to influence file system permissions. The file gets saved to disk in the context of the windows user that is the identity on the app pool whether uploaded from file manager or from the editor.

I suggest re-apply the full control permissions to the to the /Data folder and make sure you check the option to propagate the permissions to all child objects.

Do the same with the /App_Data folder, it needs the same full control there.

In IIS 7.x, click the site then double click authentication, make sure the only things enabled there are Anonymous and Forms Authentication, make sure impersonation is not enabled.

Hope that helps,

Joe

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