I got my upload working using cookbook techniques and since it is
working I don't have time to figure out exactly what it is doing.
But I do display the selected File name after the user selects from the
File brows dialog box. Note the line near the end, where I set the
textInput tiFileName.text. You will need to analyze this code to
underestand what it is doing, I do not remember.
Note, you can NOT display the full path to the file on the local file
system, for security reasons.
Tracy
// Called when a file is selected
private function onSelectFile(event:Event):void {
this.enabled = true;
var arrFoundList:Array = new Array();
if (bMultipleSelect) {
// Get list of files from fileList, make list of files already on
upload list
for (var i:Number = 0; i < _aUploadFiles.length; i++) {
for (var j:Number = 0; j < _refAddFiles.fileList.length; j++) {
if (_aUploadFiles[i].label == _refAddFiles.fileList[j].name) {
arrFoundList.push(_refAddFiles.fileList[j].name);
_refAddFiles.fileList.splice(j, 1);
j--;
}
}
}//for (var i:Number
if (_refAddFiles.fileList.length >= 1) {
for (var k:Number = 0; k < _refAddFiles.fileList.length; k++) {
_aUploadFiles.push({label:_refAddFiles.fileList[k].name,
data:_refAddFiles.fileList[k]});
}
listFiles.dataProvider = _aUploadFiles;
listFiles.selectedIndex = _aUploadFiles.length - 1;
}//if (_refAddFiles.
if (arrFoundList.length >= 1) {
Alert.show("The file(s): \n\n* " + arrFoundList.join("\n* ") +
"\n\n...are already on the upload list. Please change the filename(s) or
pick a different file.", "File(s) already on list");
}
if (_aUploadFiles.length == 0) {
btnUploadMultiple.enabled = false;
} else {
btnUploadMultiple.enabled = true;
}
}
else {
_aUploadFiles.push({label:_refAddFiles.fileList[0].name,
data:_refAddFiles.fileList[0]});
tiFileName.text = _aUploadFiles[0].label;
//btnUploadSingle.enabled = true;
}//
}//onSelectFile
-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of santoshgadagoju
Sent: Wednesday, August 20, 2008 1:34 PM
To: [email protected]
Subject: [flexcomponents] Re: Need help urgently regarding the uploading
component in flex
My request is like, i just want to put an alert showing the url of the
uploaded file from where it is uploaded when i click an item in the
list of files.
------------------------------------
Yahoo! Groups Links