TobiasNickel / tUploader

:cloud: simple web drag and drop uploader - in hTML5 + Javascript
MIT License
3 stars 1 forks source link

it don't save files to server #5

Closed fwilly closed 9 years ago

fwilly commented 9 years ago

After start the server with

php 0.0.0.0:8080 upload.php
PHP 5.5.12-2ubuntu4.3 Development Server started at Thu Apr 23 08:34:28 2015
Listening on http://0.0.0.0:8080
Document root is /home/XXXX/tUploader
Press Ctrl-C to quit.

I can see the tUploader.min.js is available for download and I can drag and drop a file to the page. But after upload and the blue process bar the file file isn't saved to server. After reload of the page the file isn' listed as available download.

Here the javascript log:

begin Object {event: MouseEvent}
(index):32 progress Object {event: MouseEvent, progressEvent: XMLHttpRequestProgressEvent, progress: 1, bitrate: 0, globalProgress: 1}
(index):32 progress Object {event: MouseEvent, progress: 1, bitrate: 0}
(index):21 success Object {event: MouseEvent, response: "true"}

The php server don't bring any additionally log messages.

What I must debug to see the problem?

fwilly commented 9 years ago

Upload per "open" Button works.

TobiasNickel commented 9 years ago

could you stop at line 65 in the jUploader.js and check if the files are in the e.datatransfer.files.

in HTML it is better to drop a file into a dropzone, did you dropped into the yellow window-filling dropzone? maybe the file is bigger then allowed from PHP.

orcas-mgleich commented 9 years ago

Okay, file was to big. Please insert a error message, if file is to big! You can read the max file size with:

php -i | grep upload_max_filesize | awk '{ print $3 }'

To get it with php exists many examples.

TobiasNickel commented 9 years ago

Thanks, now the upload.php am providing the maximum FileSize. it is available through: ini_get("post_max_size")

when there is an error or no file it returns an HTTP error-code. so the tUploader can call the error-event.

it is not perfect now, because: the filesize error would be in $_FILES[files][error] but if the file is to big, $_FILES is an empty array, so there is also no error and no file.

for now, I don't know how to find out if there was a file, that was to big. I will investigate that.

TobiasNickel commented 9 years ago

ok, running the script using PHP in apache, provides the error status in $_FILES[files][error]. so I will close that and add an .htaccess that brings all requests to upload.php