Giter Site home page Giter Site logo

Comments (8)

mikedeboer avatar mikedeboer commented on July 1, 2024

hrm, I'm curious what the content of postVars is in your case... could you console.log it and paste it in this bug?

from jsdav.

ideiudicibus avatar ideiudicibus commented on July 1, 2024

{ '-----------------------------10039407114525152981185019459\r\nContent-Disposition: form-data; name': '"jsdavAction"\r\n\r\nput\r\n-----------------------------10039407114525152981185019459\r\nContent-Disposition: form-data; name="name"\r\n\r\ntest file name\r\n-----------------------------10039407114525152981185019459\r\nContent-Disposition: form-data; name="file"; filename="test.bin"\r\nContent-Type: application/macbinary\r\n\r\n\r\n-----------------------------10039407114525152981185019459--\r\n' }

this is the console.log(postVars).
The file uploaded has been generated with the touch command.

regards

I

from jsdav.

mikedeboer avatar mikedeboer commented on July 1, 2024

That looks horrid. I don't know what touch does, but it's not making the NodeJS HTTP parser very happy!

My guess: this will be fine when you upload via your browser...

from jsdav.

ideiudicibus avatar ideiudicibus commented on July 1, 2024

it might be a misunderstanding: I created the uploaded file using the touch unix command, and I posted that file, but I tried also pdf or images, using the form. I used Firefox, Chrome and Safari to see possibily different behaviours but the request is alwasy the same. I'm tryng with formidable and the request is parsed correctly. I've inspected the post with firebug and the result is the following:

-----------------------------173963131221410905262072481350 Content-Disposition: form-data; name="jsdavAction" put -----------------------------173963131221410905262072481350 Content-Disposition: form-data; name="name" -----------------------------173963131221410905262072481350 Content-Disposition: form-data; name="file"; filename="test.bin" Content-Type: application/macbinary -----------------------------173963131221410905262072481350--

posting with chrome gives the following

`------WebKitFormBoundaryAoGsMLD1PPfZ2Cvb
Content-Disposition: form-data; name="jsdavAction"

put
------WebKitFormBoundaryAoGsMLD1PPfZ2Cvb
Content-Disposition: form-data; name="name"

------WebKitFormBoundaryAoGsMLD1PPfZ2Cvb
Content-Disposition: form-data; name="file"; filename="test.bin"
Content-Type: application/macbinary`

response is still the "Not Implemeted" xml

client and server see the same.

Any suggestions?

from jsdav.

mikedeboer avatar mikedeboer commented on July 1, 2024

ah, right! No, what I meant is console.log("POST VARS", postVars); in browser.js... can you do that?

from jsdav.

ideiudicibus avatar ideiudicibus commented on July 1, 2024

that's I was talking about in my first comment, anyway here is the log line 167 browser.js

POST VARS  { '-----------------------------104718410513947655702040927985\r\nContent-Disposition: form-data; name': '"jsdavAction"\r\n\r\nput\r\n-----------------------------104718410513947655702040927985\r\nContent-Disposition: form-data; name="name"\r\n\r\n\r\n-----------------------------104718410513947655702040927985\r\nContent-Disposition: form-data; name="file"; filename="test.bin"\r\nContent-Type: application/macbinary\r\n\r\n\r\n-----------------------------104718410513947655702040927985--\r\n' }

from jsdav.

johnsonlee avatar johnsonlee commented on July 1, 2024

I also found this issue when I use the example to upload a file to server. So, I had to write another method to parse request body instead of Qs.parse(), but there is another problem, I don't know where the postVars.tmp_file property comes from, but in jsDAV/lib/DAV/plugins/browser.js, there is a condition statement to check postVars.tmp_file

from jsdav.

mikedeboer avatar mikedeboer commented on July 1, 2024

Ah I now see where the problem is coming from. I'll try to make this work asap. I've been very busy with my (new) job at Mozilla, so my apologies for the delay.

from jsdav.

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.