Highlighted

Multiple File Upload using HTMLLoader

New Here ,
Feb 17, 2020

Copy link to clipboard

Copied

import flash.html.HTMLLoader;

var input:String = '<html><head><meta charset="UTF-8"></head><body><input type="file" name="files[]" id="abc" multiple></body></html>';
	
var loader:HTMLLoader = new HTMLLoader();
	loader.width = 400;
	loader.height = 300;
	
this.addChild(loader);
loader.loadString(input);

 

The code above didn't work. Only single file allowed.

I'm using AIR SDK 32

Mozilla/5.0 (Windows; U; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) AdobeAIR/32.0
=> Safari 5.0.3

The strange thing is, I've been download Safari 5.0.3 browser to test the code, and the code work as expected.

 

Have I missed something?

 

Please help!

Thank you!

TOPICS
Air beta, Development, Product issue

Views

344

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Multiple File Upload using HTMLLoader

New Here ,
Feb 17, 2020

Copy link to clipboard

Copied

import flash.html.HTMLLoader;

var input:String = '<html><head><meta charset="UTF-8"></head><body><input type="file" name="files[]" id="abc" multiple></body></html>';
	
var loader:HTMLLoader = new HTMLLoader();
	loader.width = 400;
	loader.height = 300;
	
this.addChild(loader);
loader.loadString(input);

 

The code above didn't work. Only single file allowed.

I'm using AIR SDK 32

Mozilla/5.0 (Windows; U; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) AdobeAIR/32.0
=> Safari 5.0.3

The strange thing is, I've been download Safari 5.0.3 browser to test the code, and the code work as expected.

 

Have I missed something?

 

Please help!

Thank you!

TOPICS
Air beta, Development, Product issue

Views

345

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Feb 17, 2020 0
Enthusiast ,
Feb 20, 2020

Copy link to clipboard

Copied

your input tag is not wrapped into a form tag

also you need a backend to upload the files to, for ex: PHP
see Uploading multiple files

 

also you do not need HTML to uplaod files to a server
you can use the FileRefernece class directly in AIR
see Using the FileReference class - Uploading files to a server

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 20, 2020 0
asnext LATEST
New Here ,
Feb 20, 2020

Copy link to clipboard

Copied

Thank you, zwetan.

I've tried to wrap the input tag into a form tag. Still didn't work.

Actually I don't have access to the server, so all I can do is looking for a way to change the html. I can't use FileReference since I can't modify the PHP file.

 

Thank you!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 20, 2020 0