How to upload file with http post on ruby on rails

Last post 04-16-2008 3:57 PM by BarryR. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 01-24-2008 4:39 AM

    How to upload file with http post on ruby on rails

    Hi..

    I want upload file to nirvanix using http post, but i can figure it out?

    Anybody can help me, i'm very newly on this

     

    Thank's 

  • 01-24-2008 3:18 PM In reply to

    • BarryR
    • Top 10 Contributor
    • Joined on 07-20-2007
    • San Diego
    • Posts 617

    Re: How to upload file with http post on ruby on rails

    We have a ruby gem available to help simplify calling our system.  You can get it by typing "gem i nvx-sds" or you can download and install it from: http://nvx-sds.rubyforge.org/.  On that page you will find the documentation for doing an http upload in the second section and the rubydoc for the whole gem sdk.

    Best of luck,
        Barry R.
     

    IM Support (Feel free to add me)

    MSN: barryruffner@msn.com
    Gmail: barryruffner@gmail.com
    Filed under: , , ,
  • 04-16-2008 3:19 AM In reply to

    Re: How to upload file with http post on ruby on rails

    can someone post some starter code or an example to upload a file with http post from the browser?  that would be extremely appreciated.  thanks.
  • 04-16-2008 6:59 AM In reply to

    • BarryR
    • Top 10 Contributor
    • Joined on 07-20-2007
    • San Diego
    • Posts 617

    Re: How to upload file with http post on ruby on rails

    I will try to get a Rails example together to show you a simple upload and link creation.

    Regards,
        Barry R.

    IM Support (Feel free to add me)

    MSN: barryruffner@msn.com
    Gmail: barryruffner@gmail.com
  • 04-16-2008 8:28 AM In reply to

    Re: How to upload file with http post on ruby on rails

    This code i used to upload video on my ROR app:

    <h5>Upload File(s) In Folder <%= @folder_name%><h5>

    <form ENCTYPE="multipart/form-data" action="http://<%= @node%>/Upload.ashx" method="post">
      <p><input type="hidden" name="uploadToken" value = <%= @upload_token %>></p>
      <p><input type="hidden" name="forwardingUrl" value = <%= request.env['HTTP_REFERER'] %>></p>
      <p><input type="hidden" name="destFolderPath" value = <%= @folder_name %>></p>
      <p>File 1: <input type="file" name="uploadFile1"/></p>
      <p>File 2: <input type="file" name="uploadFile2"/></p>
      <p><input type="submit" value="Send"/></p>
    </form>
    <%=link_to 'Folder [create or select]', new_folder_upload_file_to_nirvanix_path%>

    maybe this can help you.

     regards

    --Dana--
     

  • 04-16-2008 3:02 PM In reply to

    Re: How to upload file with http post on ruby on rails

    can you elaborate on the steps before the upload form is created - how the upload token is generated for example.

    as a sidenote, my app has multiple users and each of them will have their storage and bandwidth limited to fixed amounts - would they all be using the same upload token?

    thanks - i just started using nirvanix and appreciate your patience.  we're hoping to migrate from S3 and this looks promising so far.

     

  • 04-16-2008 3:57 PM In reply to

    • BarryR
    • Top 10 Contributor
    • Joined on 07-20-2007
    • San Diego
    • Posts 617

    Re: How to upload file with http post on ruby on rails

    vince_walker:
    as a sidenote, my app has multiple users and each of them will have their storage and bandwidth limited to fixed amounts - would they all be using the same upload token?
     

    Each user must have their own token since this is how you identify what account you will upload into.  The steps before this would be creating a session and getting a storage node.  You can take a look at the Ruby SDK in the SoapUpload.UploadFile method for that code.

    Regards,
        Barry R.

    IM Support (Feel free to add me)

    MSN: barryruffner@msn.com
    Gmail: barryruffner@gmail.com
Page 1 of 1 (7 items)