Question

I've been searching google abit and could not find anything that would help! I have a customer that would like to upload large CSV files of products (A right pain as there 150mb plus uncompressed).

I Noticed that he gets the files compressed from the wholesaler with gz (down to 6mb). I've been trying to upload the gz via the admin form I've created for him but the $_FILES global is empty when submitting (this is after it has gone through the upload to the tmpdir)

everything works fine if i upload the uncompressed csv (as in the $_FILES global is not empty), So i'm guessing the server is blocking the file? but i can't find anything about this and checking out other upload scripts people are allowing the extension.

Form Below:

<form action="/admin.php?current_page=new_upload" method="post" enctype="multipart/form-data">

<label for="csvFile">CSV File: (*)</label>
<input class="form-control" type="file" required name="csvFile" id="csvFile" />        
<input class="btn btn-success" id="subBtn" type="submit" value="Upload CSV to Site" />
</form>

Getting tmp_name here which is empty when trying to upload gz file (first line on the file):

$fn = $_FILES['csvFile']['tmp_name'];

put a var_dump($_FILES) at the top of the file and its completely empty, so its getting lost before hitting any of the script

But no issues if I upload a .csv file

Was it helpful?

Solution

So i finally gave in and uploaded the huge uncompressed file, which failed, i then GZ'd the sample data and it worked fine, so it must be an issue with file size, and even though the gz is only 6mb (we've set the limit to 150mb) the server must be reading the file at its actual size before even touching the script.

I'll be playing around with the server settings, but thanks for looking anyway!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top