Giter Club home page Giter Club logo

Comments (6)

weixiyen avatar weixiyen commented on September 7, 2024

I don't have PHP so I can't test. I made this work with Python though.

Could you try messing with the boundary variable on line 176?
boundary = '------multipartformboundary' + (new Date).getTime(),

Perhaps PHP is expecting something different.

from jquery-filedrop.

weixiyen avatar weixiyen commented on September 7, 2024

perhaps try replacing line 176 with
boundary = '--PHP-MIX--' + (new Date).getTime(),

let me know if that works for u

from jquery-filedrop.

sahl avatar sahl commented on September 7, 2024

I got PHP working by changing line 191 to:

xhr.sendAsBinary('Content-Type: multipart/form-data; boundary='+boundary+'\r\nContent-Length: '+builder.length+'\r\n\r\n'+builder);

Using that fix, you can use the $_FILES array in PHP.

Also changed line 81 to:

builder += crlf+crlf;

in order to get other variables to transfer correctly.

from jquery-filedrop.

pc180 avatar pc180 commented on September 7, 2024

Thanks for the update sahl, $_POST and $_FILES are set correctly with your change.
Now that it is working there appears to be another problem. If I drag more than about 4 large files (about 1-2 meg each), the script fails on line 177:
builder = getBuilder(file.name, e.target.result, boundary);
with a console message 'file is not defined'.
There is a similar problem when using the script from http://www.thecssninja.com/javascript/fileapi, so I expect it is a Firefox issue. I am using v3.6.10

from jquery-filedrop.

sahl avatar sahl commented on September 7, 2024

Tried dragging 8 files, with sizes up to 5+ MB, and encountered no problems, also using Firefox 3.6.10 (windows). Maybe a permission problem on the file itself?

from jquery-filedrop.

weixiyen avatar weixiyen commented on September 7, 2024

thanks for the help sahl

from jquery-filedrop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.