You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by yi...@apache.org on 2019/07/22 08:45:01 UTC

[royale-asjs] branch develop updated: Add content type to uploader

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

yishayw 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 50632e0  Add content type to uploader
50632e0 is described below

commit 50632e0a7035e3c48bcadf3cf7eb8975b16a7fdf
Author: DESKTOP-RH4S838\Yishay <yi...@hotmail.com>
AuthorDate: Mon Jul 22 11:44:49 2019 +0300

    Add content type to uploader
---
 .../org/apache/royale/file/beads/FileUploader.as   | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)

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 c8eb3cb..e6f79d0 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
@@ -62,6 +62,7 @@ package org.apache.royale.file.beads
 	public class FileUploader implements IBead
 	{
 		private var _strand:IStrand;
+		private var _contentType:String;
 		
 		/**
 		 *  Upload a file to the specified url.
@@ -80,6 +81,10 @@ package org.apache.royale.file.beads
 //			}
 			var binaryUploader:URLBinaryLoader = new URLBinaryLoader();
 			var req:URLRequest = new URLRequest();
+			if (contentType)
+			{
+				req.contentType = _contentType;
+ 			}
 			req.method = "POST";
 			req.data = (host.model as IFileModel).blob;
 			req.url = url;
@@ -114,5 +119,23 @@ package org.apache.royale.file.beads
 			return _strand as FileProxy;
 		}
 		
+		
+		/**
+		 *  The content type. Default is the default in URLRequest.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.6
+		 */
+		public function get contentType():String 
+		{
+			return _contentType;
+		}
+		
+		public function set contentType(value:String):void 
+		{
+			_contentType = value;
+		}
 	}
 }