4 Answers

1
votes

Have you tried created an URLRequest with its own URLRequestHeader entries?

var request:URLRequest = new URLRequest("http://www.example.com/post.php");
request.method = URLRequestMethod.POST;

var header:URLRequestHeader = new URLRequestHeader("pragma", "no-cache");
request.requestHeaders.push(header);

fileRef.upload(request); 
1
votes

In short, no.

From the docs:

The requestHeaders property of the URLRequest object is ignored; custom HTTP request headers are not supported in uploads or downloads.

EDIT: just fixed some specifics.

0
votes

Just had a same problem, use file upload via URLLoader, and use zehs solution to setup headers.

Just put your file inside of request.data, and setup method to POST.

0
votes

You can UrlRequest as before but you use a helper class to send the content of the file. Here is the answer:

https://stackoverflow.com/a/12933681/1753025