Pass variables?
Hello!
I have this code and I'm trying to upload files to the server. I'm using .NET(C#) now I wonder how I can pass the filename, path and so on to the aspx-page?
var fileRef:FileReferenceList = new FileReferenceList();
fileRef = new FileReferenceList();
var uploadURL:URLRequest = new URLRequest();
var uploadPhotoString:String = "http://localhost/cs/upload.aspx";
uploadURL.url = uploadPhotoString;
function fileSelectHandler(event:Event):void{
for each(var fileToUpload:FileReference in fileRef.fileList){
uploadSingleFile(fileToUpload);
lblUpload.htmlText = fileToUpload.name + "<br />";
}
}
function uploadSingleFile(file:FileReference):void{
file.upload(uploadURL);
file.addEventListener(Event.COMPLETE, completeHandler);
}
function completeHandler(event:Event):void{
trace("Uppladdningen lyckades");
}
btnUpload.addEventListener(MouseEvent.MOUSE_DOWN, reportClick);
function reportClick(event:MouseEvent) {
fileRef.browse();
fileRef.addEventListener(Event.SELECT, fileSelectHandler);
fileRef.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
};
function ioErrorHandler(event:IOErrorEvent):void {
trace("Det uppstod ett IO fel");
};