Menu

[r556]: / swfupload / trunk / FlashDevelop / SWFUpload / FileItem.as  Maximize  Restore  History

Download this file

52 lines (41 with data), 1.6 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package {
import flash.net.FileReference;
internal class FileItem
{
private static var file_id_sequence:Number = 0; // tracks the file id sequence
private var postObject:Object;
public var file_reference:FileReference;
public var id:String;
public var file_status:int = 0;
public static var FILE_STATUS_QUEUED:Number = 0;
public static var FILE_STATUS_IN_PROGRESS:Number = 1;
public static var FILE_STATUS_ERROR:Number = 2;
public static var FILE_STATUS_COMPLETE:Number = 3;
public static var FILE_STATUS_CANCELLED:Number = 4;
public function FileItem(file_reference:FileReference, control_id:String)
{
this.postObject = {};
this.file_reference = file_reference;
this.id = control_id + "_" + (FileItem.file_id_sequence++);
this.file_status = FileItem.FILE_STATUS_QUEUED;
}
public function AddParam(name:String, value:String):void {
this.postObject[name] = value;
}
public function RemoveParam(name:String):void {
delete this.postObject[name];
}
public function GetPostObject():Object {
return this.postObject;
}
// Create the simply file object that is passed to the browser
public function ToJavaScriptObject():Object {
var file_object:Object = { id: this.id, name: this.file_reference.name, size: this.file_reference.size, type: this.file_reference.type, creationdate: this.file_reference.creationDate };
file_object.post = this.GetPostObject();
return file_object;
}
public function toString():String {
return "FileItem - ID: " + this.id;
}
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.