Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ERROR:
Quote:
The SaveAs method is configured to require a rooted path, and the path '192.168.1.9//E://pranav//nokia.jpg' is not rooted.


My COde:

C#
protected void btnUpload_Click(object sender, EventArgs e)
    {
        if (FileUpload1.HasFile)
        {

            filename = FileUpload1.PostedFile.FileName;
            
            string filepathfb = "192.168.1.9//E://pranav//" + filename;

            FileUpload1.SaveAs(filepathfb);


whereas, 192.168.1.9 is the IP of the other PC where i want to store my image....
Help..!!
Posted

1 solution

Two ways:
1) Create a network drive connection to the remote machine (so it appears to your computer as "X:" for example) and save to that.
2) Use the full UNC path specification: //RemoteMachineName/SharedFolder/pranav
 
Share this answer
 
Comments
Pranav-BiTwiser 18-Mar-14 13:06pm    
like this...?
string filepathfb = "//Rizwaan-PC//SharedFolder//pranav//" + filename;

FileUpload1.SaveAs(filepathfb);
OriginalGriff 18-Mar-14 13:43pm    
no - it needs two slashes at the front, the just one for separation.
Pranav-BiTwiser 18-Mar-14 13:08pm    
if suppose, i want to save my image file into the specific drive e.g. E: drive, of another computer....is it possible using C#?
OriginalGriff 18-Mar-14 13:43pm    
Only if it is available as a shared folder and you have been granted write permissions.
Pranav-BiTwiser 18-Mar-14 14:09pm    
ok..thank you...:)

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