ProgerXP / FileDrop

Self-contained cross-browser pure JavaScript class for Drag & Drop and AJAX (multi) file upload.
filedropjs.org
The Unlicense
264 stars 61 forks source link

Not Receiving $_FILE in PHP #64

Open teamcoltra opened 7 years ago

teamcoltra commented 7 years ago

To be honest, I am an idiot on how $_FILE actually works but it seems as though the code only sends the raw file to PHP and doesn't send it like normal files arrive when I use a standard HTML form.

I have seen other questions about this like on http://stackoverflow.com/questions/25698444/filedrop-js-php-resulting-in-empty-files

There is a solution there that DOES work but it doesn't really fit the system that I have already built. I am not sure how to properly ask the question, but is there a way to get the files to respond how they would if I was to submit this form:

<form action="index.php" method="post" enctype="multipart/form-data">
    <input type="file" name="test[]" id="test" multiple>
    <input type="submit" value="Upload Image" name="submit">
</form>

I am not asking you to implement the feature, per-se just wondering if I am doing something wrong.

teamcoltra commented 7 years ago

Side note: I realize I can just drag and drop into the above form without FileDrop but that doesn't give me auto-uploading, or the nice HTML customization, or any of the other nice tools that file drop has.

ProgerXP commented 7 years ago

It was already asked before: https://github.com/ProgerXP/FileDrop/issues/63