upload raises exception in Sinatra app

Comments

2 comments

  • Avatar
    Ian Burry

    Ok, I figured it out. The hint's in the exception, even if it was a bit confusing at first.  The upload() method wants a file object or a string file path, not a hash, indifferent or otherwise. So, using file['tempfile'], or file['tempfile'].path does the trick. I guess it's the difference between a regular form submit, and an ajax request like I'm using here.

    0
    Comment actions Permalink
  • Avatar
    Ido

    Hi, Ian.

    Glad to hear it's working :)

    Please let us know if you need anything else.

    Regards,
    Ido

    0
    Comment actions Permalink

Please sign in to leave a comment.