SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    May 2008
    Location
    Missouri, USA
    Posts
    273
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    AJAX PUT Compatability Question

    I'm trying to figure out the best way to use a PUT request to upload a file to a service. I've done some research on doing this with regular javascript and jquery.

    I see that jQuery has support for PUT in the $.ajax method
    The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers.
    However, I'm worried about the mention of browser compatibility. Does anyone know exactly what browsers do not support the PUT type for this $.ajax function? Its important that it work in IE6-9.

    Do you have any other suggestions for performing this action with javascript?
    Follow Me On Twitter: BryceRay

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Yes. Use POST. Modern browsers now allow you to upload something with ajax. IE doesn't yet, but you can use a hidden iframe. There are scripts out there that will do it for you. Just search for "ajax upload". Example: Ajax Upload; A file upload script with progress-bar, drag-and-drop.

  3. #3
    SitePoint Addict
    Join Date
    May 2008
    Location
    Missouri, USA
    Posts
    273
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've got another question concerning PUT. The way I'm going to upload this file is from some embedded XML.

    Meaning, when the page loads there will be XML embedded into the html page but in a hidden state. I will then grab that XML as a string from the HTML source. Should I perform any sort of conversion for this string? Or can I just use this string to send it as a file using PUT or POST?

    Let me know if I need explain this better
    Follow Me On Twitter: BryceRay


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •