Skip to main content
Participant
February 18, 2020
Question

Multiple File Upload using HTMLLoader

  • February 18, 2020
  • 1 reply
  • 628 views
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!

This topic has been closed for replies.

1 reply

Inspiring
February 20, 2020

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

asnextAuthor
Participant
February 20, 2020

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!