PDA

View Full Version : [CLOSED] Multiupload getFile(n)



rbtceo
Feb 14, 2016, 11:18 PM
Hi All,

I checked documentation http://www.calvarycch.org/content/SWFUpload/Documentation/#getFile
and I get file object


{
id : string, // SWFUpload file id, used for starting or cancelling and upload
index : number, // The index of this file for use in getFile(i)
name : string, // The file name. The path is not included.
size : number, // The file size in bytes
type : string, // The file type as reported by the client operating system
creationdate : Date, // The date the file was created
modificationdate : Date, // The date the file was last modified
filestatus : number, // The file's current status. Use SWFUpload.FILE_STATUS to interpret the value.
post : object // The post params that will be sent with this file (compiled from the post_params setting and any params added with the addFileParam function

}

Is there any way to get file binary file data on client?

Thank you.

fabricio.murta
Feb 16, 2016, 3:09 AM
Hello @rbtceo!

Unfortunately the underlying flash framework does not export a method to return the selected file's data. It is only used during POST, internally by the flash component.

Well, that's the part of the bad news.

Good news is that you can probably do it with the information you have using JavaScript's FileReader (https://developer.mozilla.org/en/docs/Web/API/FileReader).

I hope this helps!

If MultiUpload does not work with FileReader, you may try using the FileUploadField instead. According to this stackoverflow thread (http://stackoverflow.com/questions/7109189/ext-js-3-get-data-from-fileuploadfield), you can use FileReader with it.

For FileUploadField, you get the file to-be-uploaded file handle via: App.FileUploadField1.fileInputEl.dom.files.

rbtceo
Feb 16, 2016, 3:24 AM
Thank you.