Read data from enctype="multipart/form-data" form

Discussion in 'Ruby' started by Kevin DeValck, May 17, 2011.

  1. Hi,

    i'm trying to upload a picture on a ruby server. I succeed in it when i
    make a form with only the abbility to upload a file.
    But the problem is when i try to make a form with additional information
    like a textarea.
    So my question is, how can i retreive the parameters from a from with
    enctype="multipart/form-data".

    In a normal form i can do like this to retreive the info: numb =
    @cgi["numb"]
    But with enctype="multipart/form-data" it says that numb is stringio or
    a file. So how can i get that original data that was in it?

    Thanks

    --
    Posted via http://www.ruby-forum.com/.
    Kevin DeValck, May 17, 2011
    #1
    1. Advertising

  2. Kevin DeValck

    7stud -- Guest

    Kevin DeValck wrote in post #999235:

    > But with enctype="multipart/form-data" it says that numb is stringio or
    > a file. So how can i get that original data that was in it?
    >


    How would you get the contents of a file?

    contents = numb.read

    --
    Posted via http://www.ruby-forum.com/.
    7stud --, May 17, 2011
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    8
    Views:
    141,970
    zeeshanakhter2009
    May 26, 2012
  2. Duncan
    Replies:
    0
    Views:
    1,439
    Duncan
    Feb 24, 2006
  3. Matt
    Replies:
    1
    Views:
    11,131
    David Dorward
    Oct 12, 2004
  4. Stimp
    Replies:
    1
    Views:
    873
    Karl Seguin [MVP]
    Nov 9, 2006
  5. David Lozzi

    Using <form ... enctype="multipart/form-data">

    David Lozzi, Aug 12, 2003, in forum: ASP General
    Replies:
    5
    Views:
    311
    Martin CLAVREUIL
    Aug 12, 2003
Loading...

Share This Page