This is an automated email from the ASF dual-hosted git repository.

piotrz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 1bcd5cf  FileUploader: Give user possibility to do not specify any 
contentType
1bcd5cf is described below

commit 1bcd5cfb35abccc09936673ed858a34a6d2e980c
Author: Piotr Zarzycki <[email protected]>
AuthorDate: Wed Jul 31 14:37:53 2019 +0200

    FileUploader: Give user possibility to do not specify any contentType
---
 .../src/main/royale/org/apache/royale/file/beads/FileUploader.as | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git 
a/frameworks/projects/Network/src/main/royale/org/apache/royale/file/beads/FileUploader.as
 
b/frameworks/projects/Network/src/main/royale/org/apache/royale/file/beads/FileUploader.as
index abed3e9..5869571 100644
--- 
a/frameworks/projects/Network/src/main/royale/org/apache/royale/file/beads/FileUploader.as
+++ 
b/frameworks/projects/Network/src/main/royale/org/apache/royale/file/beads/FileUploader.as
@@ -23,6 +23,7 @@ package org.apache.royale.file.beads
        import org.apache.royale.events.IEventDispatcher;
        import org.apache.royale.file.FileProxy;
        import org.apache.royale.file.IFileModel;
+       import org.apache.royale.net.HTTPConstants;
        import org.apache.royale.net.URLBinaryLoader;
        import org.apache.royale.net.URLRequest;
 
@@ -62,7 +63,7 @@ package org.apache.royale.file.beads
        public class FileUploader implements IBead
        {
                private var _strand:IStrand;
-               private var _contentType:String;
+               private var _contentType:String = 
HTTPConstants.FORM_URL_ENCODED;
                
                /**
                 *  Upload a file to the specified url.
@@ -81,10 +82,8 @@ package org.apache.royale.file.beads
 //                     }
                        var binaryUploader:URLBinaryLoader = new 
URLBinaryLoader();
                        var req:URLRequest = new URLRequest();
-                       if (_contentType)
-                       {
-                               req.contentType = _contentType;
-                       }
+                               req.contentType = contentType;
+
                        req.method = "POST";
                        req.data = (host.model as IFileModel).blob;
                        req.url = url;

Reply via email to