SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2007
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Prototype serialize files ?

    Hello,

    I read across www that Prototype library cannot serialize form files?
    I'm trying to build an AJAX uploader and since my application is already using Prototype I was wondering, is it possible to achieve that with it?

    Thank you !

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Javascript has no access to files on the user's machine, so you can't read them or serialize them or anything. You have to let the browser upload the file the standard way.

    The only way I know of to semi-automate <input type="file"> components is to use a hidden iframe, populate it with the file inputs, fill in the data and let the iframe upload them, that way the original page doesn't reload.

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2007
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jimfraser View Post
    Javascript has no access to files on the user's machine, so you can't read them or serialize them or anything. You have to let the browser upload the file the standard way.

    The only way I know of to semi-automate <input type="file"> components is to use a hidden iframe, populate it with the file inputs, fill in the data and let the iframe upload them, that way the original page doesn't reload.
    Thank you very much for the tip, i really appreciate it!


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
  •