File upload issue after upgrade - FileService.js

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.
1/29/2015 3:58:59 AM
Gravatar
Total Posts 7

File upload issue after upgrade - FileService.js

Hello all,

Recently I carried out an upgrade to mojoPortal, the first since it was installed in 2010 (version 2.3.1.3).

Technical details:

MojoPortal 2.4.0.4
Windows Server 2008 R2
SQL Server 2012
IIS 7.5
.NET 4.0 (for app pool)

We are experiencing an issue with the file manager and adding files to the navigation parent/child tree structure. The main issue is the file manager. It is working from our sub domain addresses externally but there are problems with the uploading of files from external addresses purchased by our customers (example.co.uk). Please see the image of the error by clicking here and clicking Download (I have removed the site ID, the domain and the folder/file names). If anyone has an idea what could be causing this please reply! Thanks.

1/29/2015 10:34:54 AM
Gravatar
Total Posts 18439

Re: File upload issue after upgrade - FileService.js

Sorry but I don't click links from people I don't know with javascript enabled, especially when the link is some masked/shortened url that could got to some malware site for all I know.

When I click it without javascript I cannot see any image at all.

My best guess, is you have some javascript error on the page that is breaking the file uploader, even an unrelated javascript error can break it. When you upgrade a site that old, most likely there are problems in the skin resulting in javascript errors on the page that need to be fixed.

I suggest either copy one of the newer skins from under /Data/skins into /Data/Sites/[SiteID]/skins for the sites that is not working. If it works using the newer skin then you can be sure there is some problem with the old skin. You should review the Important Skin Changes article and apply any needed changes since your old version, and most importantly use web browser dev tools to look for any script errors on the page or any script files that fail to load.

1/30/2015 2:45:05 AM
Gravatar
Total Posts 7

Re: File upload issue after upgrade - FileService.js

Thank you for the reply Joe. I would have uploaded it to this thread but there was no option on this WYSIWYG editor. This is actually the url for the site and you can always google the real-time file sharing website to affirm that too. I did actually use the new skins when we upgraded and adapted them to a similar look and feel as the old ones. If it was a JavaScript issue, I cannot understand why it works on our subdomains that are available externally and not customer purchased domains. Its worth mentioning that we are using Apache to translate domains and as a reverse proxy (I don't deal with the server support side of things - so that is my understanding of it anyway). I have checked for scripts errors and other than depreciated jquery warnings, there is nothing else. I have a feeling it could be a security based issue.

1/30/2015 7:19:28 AM
Gravatar
Total Posts 18439

Re: File upload issue after upgrade - FileService.js

proxy servers are always worth mentioning.

Recently there was reported several issues with using ssl proxy servers, one problem was related to file uploads. We were creating javascript with a service url for the file upload but since the web server was not really seeing a secure request it was using http instead of https for the url meanwhile the outer url of the page was using https. The proxy handles the https but changes it to http and passes the request to the web server so the web server does not know it is a secure request and builds the service url with http and this caused it to fail to upload.

If this is what is happening in your case, I patched this issue after version 2.4.0.8 was released and I uploaded the patch to our codeplex download page for that version. For the patched solution to work depends on if the proxy server is providing any custom server variable that can be used to help the web server know when it is handling a secure request (since it is not an https request from the web server point of view). See the article using an SSL Proxy Server for more information about how to configure detection of the server variables, but keep in mind that would only work if you upgrade to 2.4.0.8 and then apply the patched version of mojoPortal.Web.dll

however if this proxy is changing the the hostname/domain name and the web server is not seeing the real host/domain name (ie the host/domain that the users sees in the browser) then the service url may still be wrong so it may not work for you, I'm just not sure.

another option is you could put this in user.config or Web.config

<add key="ForceLegacyFileUpload" value="true" />

the will downgrade the fancy javascript file uploader to a more old fashioned one at a time file upload by postback

2/2/2015 3:47:28 AM
Gravatar
Total Posts 7

Re: File upload issue after upgrade - FileService.js

Thank you for comprehensive response Joe. I have tested the web.config/user.config setting and this did not change the behaviour. I am also having issues with the renaming of files (from the file manager), would you mind telling me which permissions need to be applied to which folders (on the server-side) to allow for this operation to take place please? I have a feeling it could be related to this. Thanks.

2/2/2015 7:53:29 AM
Gravatar
Total Posts 18439

Re: File upload issue after upgrade - FileService.js

<add key="ForceLegacyFileUpload" value="true" />

this should dramatically change the user experience for file upload. note that changes in user.config are not detected by the runtime, so if you make a change there you need to touch web.config file in order to make the runtime reload appsettings.

the user that is the identity on the application pool must have full control over all files and folders starting at the /Data folder

the /App_Data folder should also be writable

all other files can be read only

note that if you move the site from one machine to another machine the file permissions can get messed up because the file owner sid does not exist on the new machine and this can cause problems updating existing individual files even if the folder permissions are correct.

2/4/2015 5:15:21 AM
Gravatar
Total Posts 7

Re: File upload issue after upgrade - FileService.js

Hello Joe,

Thank you for all your support and responses. We happened to figure out a work around issue to this problem and thought I would share this incase others come across the same problem. We had to create individual virtual hosts (one for each external URL) on our Apache server. I am still experiencing issues renaming files on the file manager though. Thanks again for your feedback.

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