Topic: Manipulating http headers before uploading

Is there a way exposed by the API to manipulate the headers sent to the server before uploading a file. The use case would be to add an authorization header before uploading to a third party server.

Re: Manipulating http headers before uploading

We can't implement this feature in all runtimes. There for it's unlikely that we will add this our self. But if some one forks and adds this feature for the runtimes that support it we might pull it in.

Re: Manipulating http headers before uploading

Thanks Spocke,

I'll follow you advice. Is the general philosophy of the lib not to implements a feature if its not supported by all runtimes, and thus ending with the lowest common denominator? Or more a case by case thing, since you're actually supporting selecting multiple files even if html4 doesn't support it.

In any case thanks for you help and this solid lib.

Re: Manipulating http headers before uploading

It's more a philosophy of only adding the things one would really need to do uploads and try to keep the runtimes as uniform as possible. I don't see a major reason why one would need to add custom headers but it wouldn't be that hard to add that feature but it would be nice to know why you need it?

Also the HTML4 runtime was contributed but it's nice to have some form of support for all browsers.

Re: Manipulating http headers before uploading

Thanks Spocke,

As mentioned, I need this to upload to a third party server such as RackSpace for example. Any operations on their cloudfiles service requires a X-Auth-Token header to be set to ensure that the operation is indeed authorized. see http://www.rackspacecloud.com/files/cf- … 090812.pdf

I want to send directly from the browser to their service to avoid the load.

Thanks for you help

Re: Manipulating http headers before uploading

Thanks for the clarification. Since if it was a some header required for a local app you could have used the multipart_params or the query string to send in the auth token. But I guess you are tied by their API in this case.

Re: Manipulating http headers before uploading

I've added a new headers options now to the GitHub version. All runtimes except BrowserPlus and HTML4 supports it.

Re: Manipulating http headers before uploading

Wow Thanks. That's good news.