Click here to Skip to main content
15,908,776 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have an Async File Uploader control inside a Repeater which is inside an update panel.
I am uploading the file into ftp, so I am not uploading the video file, using SaveAs() method.

For uploading the file in ftp, I have this saveFile method which takes these four parameter: FileName, UploadPath, FTPUser, FTPPassword.
For this FileName, I have to send the full file path.

My UploadComplete event looks like this:

C#
protected void AsyncVideoUpload_UploadedComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)
    {//VideoPath is a session variable
        VideoPath = string.Empty;
        if (AsyncVideoUpload.HasFile)
        {
           // string filepath = AsyncVideoUpload.PostedFile.FileName;
            string filepath = e.filename;//above two captures only the file name,but I want the total path,like c:/MyDocuments/...
           
            UploadFile(filepath, "ftp://172.20.117.102", "test", "Value*12");
            VideoPath = AsyncVideoUpload.PostedFile.FileName;
        }
    }


Please help.
Posted
Updated 1-Sep-10 21:28pm
v2
Comments
Dalek Dave 2-Sep-10 3:29am    
Edited for Code Block and Grammar.

I'm not a 100% certain, but I'm almost sure you will get a security exception. Why would you need the full path on the users computer anyway? Unless you were duplicating the structure of the source on the FTP, but then a FileUpload component really isn't going to get you far.

P.s. Even Silvelight will not allow you to get the full path of a file.
 
Share this answer
 
client file path is protected ,you can't get it
 
Share this answer
 
If I dont provide the Full Filpath to my UploadtoFTP()method,how will it read it?
The workaround,what I thought,is:giving the ftp path (d:/ftp/test)in the hardcode and appending the filename to it(d:/ftp/test/myfile.png)and send it to UploadtoFTP()method.
Since I have write authority in my local ftp,it can be uploaded and there wont be any cross browser issue.
For your info,IE captures the full path,unlike Mozilla FF.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900