Nico Knoll Posted September 28, 2014 Share Posted September 28, 2014 Hey, I'm trying to upload a couple of files between 5 and 30mb and I always ending up getting this errors in the console and the loading bars just stop moving: I tried it on two different sites on different servers running PW (2.3.1 and 2.4.0). I even tried Firefox and Chrome with both sites. Not sure if it fixed in PW 2.5 already... Edit: Same problem with 2.5 Link to comment Share on other sites More sharing options...
horst Posted September 28, 2014 Share Posted September 28, 2014 (edited) Nico, this is not a PW related thing. It is related to your server I think: Server responded with a status of 503 (Service Unavailable) What does it say in the phpinfo for: post_max_size upload_max_filesize You may try to bump that up in the htaccess: <IfModule mod_php5.c> php_value post_max_size 240M php_value upload_max_filesize 200M </IfModule> Maybe also you can check what is set as the temp upload dir in phpinfo, and if that exists and is writeable by PHP. And, does it work with small files, < 1MB ? Edited September 28, 2014 by horst added one more thought :) Link to comment Share on other sites More sharing options...
Nico Knoll Posted September 28, 2014 Author Share Posted September 28, 2014 It works perfectly with files up to 1.5mb. Maxfile size is by 40mb at the moment. I'll try your code. Thanks so far! (I'm going to install ProcessDiagnostics to check that ) Edit: Can't find it in ProcessDiagnostics. Would be a good thing to add I think. 1 Link to comment Share on other sites More sharing options...
Nico Knoll Posted September 28, 2014 Author Share Posted September 28, 2014 Adding those lines to .htaccess doesn't help. Is it possible to add those files into the right folder via ftp and somehow let PW import them? Link to comment Share on other sites More sharing options...
Nico Knoll Posted September 28, 2014 Author Share Posted September 28, 2014 But another thing I recognised: If you're multiplying the percentage you always get ca. 2.10mb. post_max_size and upload_max_filesize are both 30M Link to comment Share on other sites More sharing options...
netcarver Posted September 28, 2014 Share Posted September 28, 2014 (edited) @nico, I'll add those lines. Update: Done, added to DiagnosePhp.module. Edited September 28, 2014 by netcarver 2 Link to comment Share on other sites More sharing options...
Nico Knoll Posted September 28, 2014 Author Share Posted September 28, 2014 I disabled Ajax uploading and get this after a couple of minutes: Link to comment Share on other sites More sharing options...
horst Posted September 28, 2014 Share Posted September 28, 2014 (edited) Is it possible to add those files into the right folder via ftp and somehow let PW import them? I wouldn't use the site/assets/files/id/ folder, you should create / use a temp folder besides site and wire: |-site |-temp |-wire and then I would try to add them via API: $targetpage->filefield->add('/fullpath/to/temp/basename.ext'); // or is it called ->addfile()? PS: if you would use a site/assets/files/id/ folder, it would create a basename-1.ext file I believe. (but not sure) Edited September 28, 2014 by horst 1 Link to comment Share on other sites More sharing options...
Nico Knoll Posted September 28, 2014 Author Share Posted September 28, 2014 I like that idea! I'll try it. Link to comment Share on other sites More sharing options...
netcarver Posted September 28, 2014 Share Posted September 28, 2014 Nico, is the upload taking longer than the max runtime of PHP scripts? 1 Link to comment Share on other sites More sharing options...
KentBrockman Posted September 28, 2014 Share Posted September 28, 2014 In my point of view horst is right. But you have to define the max sizes in the php.ini Link to comment Share on other sites More sharing options...
horst Posted September 28, 2014 Share Posted September 28, 2014 (edited) Nico, is the upload taking longer than the max runtime of PHP scripts? I think this isn't relevant for uploads, but also remember that there is something called like max-input-time in the php.ini? EDIT: no, this (max_input_time) is also not relevant: max_execution_time = 30 ; Maximum execution time of each script, in seconds max_input_time = 60 ; Maximum amount of time each script may spend parsing request data memory_limit = 256M ; Maximum amount of memory a script may consume (128MB) file_uploads = On post_max_size = 240M upload_max_filesize = 200M upload_tmp_dir = Edited September 28, 2014 by horst 1 Link to comment Share on other sites More sharing options...
netcarver Posted September 28, 2014 Share Posted September 28, 2014 (edited) @horst, don't know if it does or not. Here's another possible starting point though: set_time_limit() Update1: Looks like you might be right according to this on Stack Overflow. @nico, there are some apache config options to check in there too. Update2: Added the timeouts to DiagnosePhp.module as well. Edited September 28, 2014 by netcarver 3 Link to comment Share on other sites More sharing options...
KentBrockman Posted September 28, 2014 Share Posted September 28, 2014 In my point of view horst is still right. But it depends on your hosting solution (hoster) what you are allowed to do with the php.ini! Have a look at it in advance. Link to comment Share on other sites More sharing options...
netcarver Posted September 28, 2014 Share Posted September 28, 2014 How about this: Apache has a Timeout directive and IIS has a CGI timeout function. Both default to 300 seconds. See your web server documentation for specific details. Link to comment Share on other sites More sharing options...
horst Posted September 28, 2014 Share Posted September 28, 2014 Update2: Added the timeouts to DiagnosePhp.module as well. @netcarver: good! Can you also please do a check if it is possible to increase / decrease the max_execution_time with set_time_limit() or ini_set('max_execution_time') and reflect that in the output? Normally it should work but some (cheap shared) servers may have it disabled. Link to comment Share on other sites More sharing options...
Nico Knoll Posted September 28, 2014 Author Share Posted September 28, 2014 Problem is that this is a clients shared host. So I don't have access to php.ini... Link to comment Share on other sites More sharing options...
horst Posted September 28, 2014 Share Posted September 28, 2014 I have uploaded a file of 42MB to my site via the PW admin to a file field. It tooks 8 minutes for successfull upload. My settings from php.ini on this site are: file_uploads On max_file_uploads 20 // this I have found too, sounds like max number for simultaneous uploads upload_max_filesize 200M upload_tmp_dir post_max_size 240M max_input_time 60 // has nothing to do with time used for fileupload!! memory_limit 256M enable_post_data_reading On // this I have found too, don't know what it mean max_input_time is set to 60 seconds, so this is not relevant for fileuploads I think. ------ PS: @KentBrockman: thanks for the continued support. 1 Link to comment Share on other sites More sharing options...
netcarver Posted September 28, 2014 Share Posted September 28, 2014 @netcarver: good! Can you also please do a check if it is possible to increase / decrease the max_execution_time with set_time_limit() or ini_set('max_execution_time') and reflect that in the output? Normally it should work but some (cheap shared) servers may have it disabled. @horst: Done for set_time_limit(). DiagnosePhp.module now at v0.0.4 2 Link to comment Share on other sites More sharing options...
Nico Knoll Posted September 28, 2014 Author Share Posted September 28, 2014 Solved it with horst's work around. It still bothers me though... <?php $filepage = $pages->get('1012'); $filepage->of(false); $filepage->files->add($config->paths->root.'tmp/file.pdf'); $filepage->save(); ?> 1 Link to comment Share on other sites More sharing options...
horst Posted September 28, 2014 Share Posted September 28, 2014 @netcarver: looks fine! Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now