Giter Site home page Giter Site logo

Comments (4)

JustHTTP avatar JustHTTP commented on August 25, 2024

Does your server work with other kinds of uploads, with curl, for example? Does it receive the request despite the file missing?

Daniel Duan
Sent from my iPhone

On Sep 21, 2016, at 8:08 AM, aguel [email protected] wrote:

Im currently on XCode 8 with Swift 3 and i have a PHP file upload handler in the server side. Using the provided playground file, and basically just changing the POST URL to my PHP handler, upload doesnt work (file not reaching the server) but no error whatsoever.

From playground:
let elonPhotoURL = Bundle.main.url(forResource: "elon", withExtension: "jpg")!
let uploadResult = Just.post("http://xxxx.com/uploader.php", files:["elon": .url(elonPhotoURL, "image/jpeg")]) // <== that's it
print(uploadResult.text ?? "")


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

from just.

aguel avatar aguel commented on August 25, 2024

Yes. As explained above, it works on other HTTP Client libraries. Basically the code uses POST, so i was thinking if this is a file upload, isnt this supposed to be PUT?

from just.

dduan avatar dduan commented on August 25, 2024

@aguel from a technical point of view, there's no different between POST and PUT. But modern conventions give them different semantic meanings. Can you post uploadResult.text here?

from just.

aguel avatar aguel commented on August 25, 2024

Not an issue at all. I missed one parameter in the data section causing the problem.

from just.

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.