• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Multiple File Upload using HTMLLoader

New Here ,
Feb 17, 2020 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

510

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
community guidelines
Enthusiast ,
Feb 20, 2020 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

Votes

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
community guidelines
New Here ,
Feb 20, 2020 Feb 20, 2020

Copy link to clipboard

Copied

LATEST

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!

Votes

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
community guidelines