JSON Error using File Picker

JSON Error using File Picker

by David Lynas -
Number of replies: 5

When trying to upload a SCORM package using file picker i Get the error

ERROR: Invalid JSON string

Server Error 500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed.

 

I have tried: -

Using a different browser

DIfferet Package

Uploading to my priviate files (Same result)

Changing the upload and post limits in php.ini

Adding a web.config file to the moodle directory with the following text in

"<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <security>
            <requestFiltering>
                <requestLimits maxAllowedContentLength="334217728" />  
            </requestFiltering>
        </security>
    </system.webServer>
</configuration>"

 

Any other tings I can try

Using version - 2.1.2

 

Thanks

Average of ratings: -
In reply to David Lynas

Re: JSON Error using File Picker

by David Lynas -

Just to answer my own question

The problem was with the maximun file upload size in IIS use command below to fix, alter MySite/MyApp to reflect your site e.g. mine was Default Website/DefaultAppPool and set the size required, the below will set it to 100Mb

appcmd set config "My Site/MyApp" -section:requestFiltering -requestLimits.maxAllowedContentLength:104857600 -commitpath:apphost

In reply to David Lynas

Re: JSON Error using File Picker

by Richard Oelmann -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Many thanks David - this solution was exactly the issue I had as well.

I kept getting the same error with anything (backup restores and general uploads) over about 25Mb - we have some big courses to transfer from 1.9 to 2.2. I had tried everything from moodle's own settings, php settings and couldn't get any progress until I came across your post. I'm more used to dealing with a LAMP set up but our university installation is on IIS.

Richard

In reply to Richard Oelmann

Re: JSON Error using File Picker

by Scott Karren -

IIS sets the default for this to 30MB, but the kicker is that IIS wants to see that in bytes, so while 30000000 (this is the default value) looks huge, it is in bytes so you have to convert the maxiumum upload size you want into bytes to get this to work correctly.

Scott

In reply to Scott Karren

Re: JSON Error using File Picker

by Fortunato Borruto -

I have the same problem. I changed php.ini but I can not upload file with size bigger then 8 MB.
I have a dedicated server with Windows Server 2008 and Plesk panel (php 5.3), I cannot change FastCGI settings beacuse IIS manager does not show this option.

In reply to David Lynas

Re: JSON Error using File Picker

by Fortunato Borruto -

As shown in http://docs.moodle.org/22/en/File_upload_size for user with IIS 7 / 7.5 is important to setup FastCGI settings.

If you have a dedicated server:

IIS Manager - > Server node (not site node) -> FastCGI settings -> double click on the row -> change keys

Activity Timeout to 3600 (one hour)
Request Timeout to 3600 (one hour)

If FastCGI settings is not visible in IIS Manager download and install 

IIS Admin Pack http://go.microsoft.com/?linkid=9655656 (x86)

IIS Admin Pack http://go.microsoft.com/?linkid=9655657 (x64)