callbackURL Not Being Called In HTTP Upload

Last post 06-30-2008 7:07 PM by BarryR. 11 replies.
Page 1 of 1 (12 items)
Sort Posts: Previous Next
  • 06-30-2008 5:03 AM

    • edpark
    • Top 50 Contributor
    • Joined on 06-29-2008
    • Posts 6

    callbackURL Not Being Called In HTTP Upload

    Is there some reason why the Nirvanix system would not execute my callbackURL after an HTTP file upload of mine?

    The file gets uploaded just fine but the URL I have specified to be called back is never redirected to (http://www.google.com in this case just for testing purposes since I'm testing from localhost).

  • 06-30-2008 8:51 AM In reply to

    • mmania
    • Top 10 Contributor
    • Joined on 01-20-2008
    • Netherlands
    • Posts 91

    Re: callbackURL Not Being Called In HTTP Upload

     I think you are mixing up the callbackURL with the forwardingURL.

    The forwardingURL is where nirvanix will forward response after the upload

    the callbackURL is a call in the background to a URL of your choice and mostly to your sever. The callbackURL is mainly used to trigger actions in the background.

    hope it helps

    ciao Luca

  • 06-30-2008 2:50 PM In reply to

    • edpark
    • Top 50 Contributor
    • Joined on 06-29-2008
    • Posts 6

    Re: callbackURL Not Being Called In HTTP Upload

     Ok, I've changed my page to use forwardingUrl but I get an ASP 'Server Error in '/' Application' message on your server now.  What happened?

  • 06-30-2008 3:07 PM In reply to

    • mmania
    • Top 10 Contributor
    • Joined on 01-20-2008
    • Netherlands
    • Posts 91

    Re: callbackURL Not Being Called In HTTP Upload

     Hi edpark,

     not sure what the error is about..

     why don't you paste some code of the form you are using? it would help us to help you :-)

     you should not be shy about posting info if you are looking for help, just make sure you are not posting sensitive info like app keys or passwords...

     ciao

     Luca

  • 06-30-2008 3:15 PM In reply to

    • edpark
    • Top 50 Contributor
    • Joined on 06-29-2008
    • Posts 6

    Re: callbackURL Not Being Called In HTTP Upload

     No problem, here's the start of my form with all the relevant bits:

     

    	
    <form action="http://node1.nirvanix.com/Upload.ashx" enctype="multipart/form-data" id="uploadform" method="post"><div style="margin:0;padding:0"><input name="authenticity_token" type="hidden" value="8b7e851d781aa05ea1cac2df12c5faa086cbfb99" /></div>
    <input id="uploadToken" name="uploadToken" type="hidden" value="ImkjAs8P-olTRNgle3Y~XsjzmZqJ~5VQz-4Ugno~O79wcqAX8Zj5SMTxkH" />
    <input id="destFolderPath" name="destFolderPath" type="hidden" value="test" />
    <input id="forwardingUrl" name="forwardingUrl" type="hidden" value="http%3A%2F%2Fwww.google.com" />


    <div class="formElement">
    <div class="formLabel"></div>
    <div class="formField">
    <input id="uploadImageFile[]" name="uploadImageFile[]" type="file" />
    </div>
    	</div>

     ...

  • 06-30-2008 3:26 PM In reply to

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

    Re: callbackURL Not Being Called In HTTP Upload

     Generally speaking Post variables should not be encoded.  Try:

    <input id="forwardingUrl" name="forwardingUrl" type="hidden" value="http://www.google.com" />

     Regards,
       Barry R.

    IM Support (Feel free to add me)

    MSN: barryruffner@msn.com
    Gmail: barryruffner@gmail.com
  • 06-30-2008 3:31 PM In reply to

    • edpark
    • Top 50 Contributor
    • Joined on 06-29-2008
    • Posts 6

    Re: callbackURL Not Being Called In HTTP Upload

     Yes, that works now, thanks.

    Why doesn't the forwardingUrl have the same information attached to it that the callbackUrl does?  Namely, the errorMessage, absolutePath of files uploaded and sizeBytes?

  • 06-30-2008 3:38 PM In reply to

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

    Re: callbackURL Not Being Called In HTTP Upload

    I believe the Forwarding URL contains the error message if there is a problem (over limits, bad upload token, etc).  The callback URL was added later and to avoid an API change we could not add the additional information to the forwarding URL to preserver backward compatability. 

    Regards,
       Barry R.

    IM Support (Feel free to add me)

    MSN: barryruffner@msn.com
    Gmail: barryruffner@gmail.com
  • 06-30-2008 3:49 PM In reply to

    • edpark
    • Top 50 Contributor
    • Joined on 06-29-2008
    • Posts 6

    Re: callbackURL Not Being Called In HTTP Upload

     That seems strange because adding parameters shouldn't affect backwards compatibility in the least.

    If I specify both the forwardingUrl and callbackUrl will they both get called?

  • 06-30-2008 4:08 PM In reply to

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

    Re: callbackURL Not Being Called In HTTP Upload

    edpark:

     That seems strange because adding parameters shouldn't affect backwards compatibility in the least.

    If I specify both the forwardingUrl and callbackUrl will they both get called?

     

    True, but we were concerned for some customers who may not be expecting the new parameter (there were some specific cases).

    Both will be called if you specify both.

    Regards,
       Barry R.

    IM Support (Feel free to add me)

    MSN: barryruffner@msn.com
    Gmail: barryruffner@gmail.com
  • 06-30-2008 6:12 PM In reply to

    • edpark
    • Top 50 Contributor
    • Joined on 06-29-2008
    • Posts 6

    Re: callbackURL Not Being Called In HTTP Upload

    Thanks for the help so far.

    A couple of things:

    1. You should correct your documentation to more accurately state that the callback URL parameter is case sensitive: 'callbackUrl' and not 'callbackURL' as it's written in 'Input Parameters' under the 'HTTP Upload' section

    2.  Is the callback URL called more than once if Nirvanix doesn't get a 200 status code?  In my test it appears to have been called 4 times on a 500 error.

  • 06-30-2008 7:07 PM In reply to

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

    Re: callbackURL Not Being Called In HTTP Upload

     Both of these should not be the case, all of our parameters should be case insensitive and the callback URL should only ever be called once. (I don't know how it could be called more than once)

    I will verify these problems to see if this is the case.

    Regards,
        Barry R.

    IM Support (Feel free to add me)

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