Jquery file upload internal server error - php

I'm using Jquery File Upload to upload files around 30mb. I'm using the chunked option so the plugin breaks the file into 30, 1 mb pieces. Unfortunately on my remote server (shared hosting) I get an 500 Internal Server Error after about 10mb or 10 chucked POSTs to the PHP upload script.
The script works 100% on localhost, and also works on my remote server if the file is smaller which leads me to believe its not the code nor the plugin but rather my server. Any idea why this is happening? I can't imagine its an execution time limit as its not one request, but many smaller ones.

Related

Error when uploading files larger than 500MB on vps server

I have a vps server (on hostinger) running on openlitespeed (cyberpanel). The website that I built uses PHP.
I created a file upload service and set my php config's post max limit to 1024M and upload max filesize to 1024M as well since both those settings work on my local when testing for large file uploads under 1gb. (I've also restarted php, as well as my server to see if it solved the issue but it still persists. I've also created a phpinfo file to confirm if my post max limit and upload max filesize were changed to 1024M/1G and they were changed)
But on my webserver, uploading files larger than 500mb gives me a "POST net::ERR_HTTP2_PROTOCOL_ERROR" on my console pointing to a line on one of my javascript code referring to my xhttp.send (specifically xhttp.send(formData) XML Http Request. This XML http request forwards the selected file to an upload.php script that processes the data. But it's not getting sent to that script due to the error.
When I get that error when uploading files larger than 500mb, I'd also get an error in my server's error log:
[NOTICE] [xxxx] [T0] [xx.xxx.xx.xxx:xxxxx:HTTP2-3#APVH_*:443_website.com] Request body size: <filesize> is too big!
The uploader works fine when uploading files under 500mb, it sends the formdata to the php upload script and stores it in the server as well as the database. But it gives an error when uploading more than that.
I've looked everywhere to solve this issue, I've also looked into openlitespeed's max request body size since it's seems like it's what the error on my error log shows, but most of the answers I've seen were from several years ago and no longer applies and didn't resolve the issue.
There doesn't seem to be any issue with my php script as well as my javascript from my tests since it works with no issues on my local server, and works fine with small file sizes on my web server.
Is there anyway to resolve this issue?

Laravel - Uploading multiple images for a single request doesn't work well on shared host

I am uploading more than 12 images files for a single requests but the online server refuses to upload those images. In my local machine it works fine, i can upload more than 20 images at once. I have configured the PHP settings for max_file_uploads = 60, upload_max_filesize=100M, post_max_size = 125M in php.ini, both on my local machine server and online server. While sending the page loads unfinishing, and at the end after a long time it responds with a Network Protocol Error, which says that:
"An error occurred during a connection to www.mydomain.com. The page you are trying to view cannot be shown because an error in the network protocol was detected."
See the screen shots of other different error responses i've also got after many trials, and it still takes a long time of loading to get those responses after sending.
The images that i am uploading are being saved on server but not all. When i upload 20 images for a single request, it can get only 8 or 10 and sometimes the last image is cut short(interrupted) before it is fully uploaded, see its picture below.
I need to get all the images i am uploading like in my local machine, and with a quick response. What else i can do for configuration in PHP or elsewhere? What's wrong on shared hosting server? Please, if you have any answer to this, you can tell me what i can do, to get all uploaded images files with a quick response.
It's clearly because of a timeout error. It's not acceptable to send multiple files with one request. Even if you get it to work right now, it will fail from time to time depending on the user connection speed and file size. Also you mentioned a quick response. So you definitely need to use ajax upload to upload files simultaneously. There are multiple upload libraries such as dropzone.

Website Uploading - Error "NaN" uploaded

I've been trying to setup a file hosting script, I've tried multiple scripts (7), and no matter what script I've used, I seem to always get the same error, and I've tried it on multiple devices, and on different HTTP(s) protocols...
(I've searched for a few days for a way to resolve this, but without finding a working solution...)
Uploading File: (Computer upload)
"Speed: NaN Bps. Remaining: NaN seconds | Progress: NaN% (NaN B / 2.45 KB)"
However, if I use something such as "Remote Upload" everything seems to work completely fine, any advice?
I've changed the php.ini file to max upload file size to 2048MB's (Just to test it)
I uploaded a simple gif, and it didn't seem to want to upload...
(Also the upload script was working completely fine before, then one day it simply stopped working...)
Apache2 Website Conf: here
(Hiding domain using example.net)

PHP - FTP Error Handling

So, I'm creating an FTP client using PHP.
What I want is, if the upload fails (timed out, connection error, etc.), it will try to upload the file again in 1 minute, and if it fails again then try in 10 minuts, until it reached the maximum time to upload the file.
Let's say I have these files in my local folder:
File1.ext, File2.ext, File3.ext. And I successfully uploaded File1.ext and File3.ext. I should reupload the File2.ext, how should I do it? Any ideas?
I am running my script in the background using exec(), and if the upload is done, it will send me an email regarding the process. And I am doing recursive upload, it checks the files in my local folder then upload it one by one then deletes it after uploading.
Thanks!

500 Internal Server Error When Uploading Images Using PHP

I'm offering users the ability to upload files using an online form, but I keep on getting 500 internal server errors whenever the file upload is processed. This is what I know:
The problem isn't related to php.ini. I've checked the max file upload size, and it's set at 2 megabytes. I get the same 500 internal server error uploading 3kb large files, as well as 100kb large files.
The problem isn't related to file permissions. The php file I'm using to upload, upload.php, has permissions set to 664, and the upload folder, called upload_pic, has folder permissions of 755.
This is not an issue with the code. The exact same code was working on my previous server. I recently bought a new server and am migrating the sites over, and this is where I'm getting my problem.
I've looked online for the past two days, but I just can't find what's causing the problem. I've seen many issues similar to mine, but most of these were resolved by changing file/directory permissions, or making edits to php.ini.
Does anyone have any other proposed solutions?
Thanks!

Categories