[GitHub] [royale-asjs] brianraymes commented on issue #708: File Upload not working in Royale

2020-04-02 Thread GitBox
brianraymes commented on issue #708: File Upload not working in Royale
URL: https://github.com/apache/royale-asjs/issues/708#issuecomment-608167534
 
 
   > @brianraymes wants to know how we can add a parameter to a request header. 
I think we need to dig a bit in URLBinaryLoader to answer that.
   
   With the changes that @aharui has made, I no longer need to add a parameter 
to the request header as it displaced the need to set my own boundary data. 
FYI, I am currently testing with PDFs.
   
   With these latest changes, I can now successfully upload, but I am left with 
a few problems that I could use some help with:
   
   1. How do I get access to the response data from the upload? I can see the 
XMLHttpRequest (xhr) in the FileUploaderUsingFormData bead, and the response 
data I need, but it is private. The servlet I am uploading to processes the 
file, creates a reference to it, and returns the `id` for me to use elsewhere.
   2. FileFilter seems to currently do nothing as well. No matter what I try, 
it always seems to filter on "All Files". This is how I'm trying to set the 
filter:
   `fileReference.browse([new FileFilter("PDF", "*.pdf")]);`
   
   Even though I have the above issues, I found a way to load data without 
requiring an upload by adding an event listener to the model for "blobChanged", 
then subsequently calling `load()`. This allows me to access the byte data so 
that I can send it over a RemoteObject call:
   `fileReference.model.addEventListener("blobChanged", blobChangedHandler);`
   
   I ended up crawling through the framework to find this event. Is this the 
expected way to capture the load event, or more of a placeholder until this is 
modeled out a bit further?
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [royale-asjs] brianraymes commented on issue #708: File Upload not working in Royale

2020-03-12 Thread GitBox
brianraymes commented on issue #708: File Upload not working in Royale
URL: https://github.com/apache/royale-asjs/issues/708#issuecomment-598411034
 
 
   @yishayw The change made does now include "multipart/form-data", but is 
still rejected by Apache Commons FileUpload as the boundary parameter is 
required according to the RFC. I'm not sure how the original Flex was doing 
this, but this is how I was using it:
   
   ```
   var header:URLRequestHeader = new URLRequestHeader("Content-type", 
"multipart/form-data; boundary=" + UploadPostHelper.getBoundary());
   uploadURL.requestHeaders.push(header);
   ```
   
   How can I add my own headers and or change the HTTP method?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [royale-asjs] brianraymes commented on issue #708: File Upload not working in Royale

2020-03-06 Thread GitBox
brianraymes commented on issue #708: File Upload not working in Royale
URL: https://github.com/apache/royale-asjs/issues/708#issuecomment-595991193
 
 
   FYI, also attempted in this way with no affect.
   ```
   uploadURL.method = HTTPConstants.POST;
   uploadURL.contentType = "multipart/form-data";
   ```
   
   The method seems to apply, but the Content Type is not included in the 
headers.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [royale-asjs] brianraymes commented on issue #708: File Upload not working in Royale

2020-03-06 Thread GitBox
brianraymes commented on issue #708: File Upload not working in Royale
URL: https://github.com/apache/royale-asjs/issues/708#issuecomment-595899570
 
 
   @yishayw I'm currently testing File Upload capabilities as well, and while I 
can browse, and supposedly send content to my java server, I see the following 
error when using Apache Commons FileUpload:
   
   > The request doesn't contain a multipart/form-data or multipart/mixed 
stream, content type header is null
   
   In Royale, I've tried augmenting the mxroyale FileReference example by 
adding the following:
   
   ```
   var header:URLRequestHeader = new URLRequestHeader("Content-type", 
"multipart/form-data");
   uploadURL.method = "POST";
   uploadURL.requestHeaders.push(header);
   ```
   
   This seems to have no affect what-so-ever. The content, while arriving to my 
java server, still contains no Content-Type.
   
   Also, in Royale, how do we access the file data from a FileReference? It 
always seems to be null. I have other cases where I send byte arrays over 
RemoteObject calls, but can't seem to access the byte data after browsing for a 
file.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services