How to File Upload in file server by using web application C#

Currently I am working to upload a csv file  Upload in file server (not on webserver) getting error , I map Y drive to our file server. (y=\\fileserver\load\)

Could not find a part of the path 'Y:\LeadsUpload\errorfixsales.xls'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'Y:\LeadsUpload\errorfixsales.xls'.

 

FileUpLoad1.SaveAs(@"Y:\\LeadsUpload\\" + FileUpLoad1.FileName);

How to fix. Please help.


Dost
My website
-1
visliCom
1/7/2009 12:05:09 AM
asp.net.web-forms 93655 articles. 5 followers. Follow

6 Replies
2314 Views

Similar Articles

[PageSpeed] 31

Using @ means you don't have to escape special charaters.

use: @"Y:\LeadsUpload\"

or use: "Y:\\LeadsUpload\\"

But not both.


Steve Wellens

My blog
1
SGWellens
1/7/2009 1:19:47 AM

i did this "Y:\\LeadsUpload\\" but now getting user not valid on server error.

now i am trying with FileUpLoad1.SaveAs(@"\\enterprise\LeadsUpload" + FileUpLoad1.FileName);
getting error

Logon failure: unknown user name or bad password.
 

please help.


Dost
My website
1
visliCom
1/7/2009 4:28:52 AM

Since this is a new issue, you should post a new thread in the Security forum.


Steve Wellens

My blog
1
SGWellens
1/7/2009 2:44:37 PM

getting same error

Could not find a part of the path 'Y:\LeadsUpload\errorfixsales.xls'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'Y:\LeadsUpload\errorfixsales.xls'.

Source Error:

Line 29:      //FileUpLoad1.SaveAs(@"c:\\inetpub\\wwwroot\\sftest3\\App_Data\\" + FileUpLoad1.FileName);
Line 30:             //FileUpLoad1.SaveAs(@"\\enterprise\LeadsUpload" + FileUpLoad1.FileName);
Line 31:             FileUpLoad1.SaveAs(@"Y:\LeadsUpload\" + FileUpLoad1.FileName);
Line 32:      //       string filepath=Server.MapPath("~/App_Data/" + FileUpLoad1.FileName);
Line 33:        //     FileUpLoad1.SaveAs(filepath);


Dost
My website
-1
visliCom
1/7/2009 8:09:02 PM

visliCom:
Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'Y:\LeadsUpload\errorfixsales.xls'.

 

Hi,

This error message directs that .NET can't find the path 'Y:\LeadsUpload\errorfixsales.xls'. Please check its existence.


Forward Sun
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
1
Forward
1/9/2009 10:05:28 AM

Hi

try this example with Button click to upload file to folder in my website and rename file:

protected void UploadFile(Object s, EventArgs e)
    {
        if (fileUpload.HasFile)
        {
            // Find the fileUpload control

            string filename = Guid.NewGuid().ToString() + Path.GetExtension(fileUpload.FileName);
            // Specify a upload directory
            string directory = Server.MapPath(”~/Upload/”);
           
                fileUpload.SaveAs(directory + filename);
                // Write a message to inform the user all is OK
                label.Text = “File <b style=’color: red;’>” + filename + “</b> uploaded.”;

                // Display the image to the user
                Image1.ImageUrl = “~/Upload/” + filename;
          }

     }

Good Luck

1
yasserzaid
1/9/2009 1:59:47 PM
Reply:

Similar Artilces:

File Upload on file server not on webserver, by using web application C#
I know how to upload files on webserver, but when trying to upload a file on different machine getting  error I am trying with FileUpLoad1.SaveAs(@"\\enterprise\LeadsUpload" + FileUpLoad1.FileName);getting error Logon failure: unknown user name or bad password.  please help.DostMy website The server services authentication credentials don't have access to your unc path. Why not create a virtual path under you webserver that points to the unc provide the necessary credentials and then write to that path versus the unc path.  Which would also b...

4 Layered Web Application for Inserting data into a database using sql server as the back end and a web form as the front end using C#
4 Layered Web Application for Inserting data into a database using sql server as the back end and a web form as the front end using C# . Can someone provide with code as I am new to this architecture and framework. Better send email. Thanks In Advance, A New Bie I suggest taking a look at the Time Tracker Starter Kit (v1.x or x2.0) or the Issue Tracker Starter Kit (v1.x).  Full source code is available.  Click on the Downloads tab above to find them.  These are not exactly what you are looking for, but perhaps they will help you get started.Terri MortonEngagement Manag...

Uploading files to a different file server but not web server
Hi, I want to upload files to a different file server than the web server using asp.net, is that possible?I can use Server.MapPath to store it on the same server. How do I save it to a different machine? What all I need? Do I need IP address? Do I need to have a shared folder on that machine? thank u for the help!!! There is only a few built in ways to get a file from one machine to another in windows.  Things like FTP, HTTP, or File Sharing - you are going to need a path to the server.  You cannot upload directly to that server.  You'll need to upload to your web s...

C#.NET WEB APPLICATION
hei guys, i need help on my application, i'm using C#.NET as front-ed and SQL as back-end, aside from a datagrid, i want to display my data using textboxes and not a datagrid, i can do it using Visual Basic 6 but since i'm a newbee at C#.NET i don't know how to do it, specially the codes, can anyone help me with it? thank you in advance! If you are doing windows development, i would suggest using 'DataForm wizard' (Use Solution Explorer-->Rightclick project-->Add new Item-->New DataForm). It will guide you through steps. If you are doing web apps. Use quickstart to learn them. h...

How to File Upload and Download file ( .doc/.pdf/.gif/.exl) from server web browser C#
How to File Upload and Download file ( .doc/.pdf/.gif/.exl) from server web browser Please help me Thanking you Saikat   Uploading: Try a Google search for upload file web server asp.net c#. Download: <a href="http://www.mydomain.com/pathtofile">Download Me</a> HTH,RyanRyan OlshanASPInsider | Microsoft MVP, ASP.NEThttp://ryanolshan.comHow to ask a question HiI want to download this logo.gif . It is possable to download. Download: <a href="http://www.google.com/intl/en/images/logo.gif">Download Me</a> and How to File Upload .doc/.pdf/.gif/.exl file we...

Help!! Problem accessing a WORD file in web server using C#.NET
Hi experts, I am trying to open the content of a WORD file from C#.NET which resides in the REMOTE SERVER, however I get an error:"System.Runtime.InteropServices.COMException: Server execution failed" when declaring new Word.ApplicationClass(). string fileName = this.btnWorkOrder1.Value;object readOnly = false;object isVisible = false;object saveChanges = false;object missing = System.Reflection.Missing.Value;object dynamic = 2; //error here:Word.ApplicationClass oWordApp = new Word.ApplicationClass(); Word.Document oWordDoc = oWordApp.Documents.Open(ref file, ref missing, ref readOnly,...

web.pb and file upload (using type=file)
Hello all. Has anyone successfully _processed_ a form with a "input type = file" based file upload via a web.pb function call? I certainly won't work by declaring an argument as a blob and accepting it that way...unless there is some post call processing I'm missing.. I'm pretty sure it is a multi-part data stream problem. Anyone have a function out there to accept the form? Thanks in advance!! I'll owe you one. -W -- William Rompala J.P. Morgan -- Lose the X before william in email address to send mail ...

Move File From Web Server to File Server
Our organization has a web server and file server in the same domain. On our public website ordering page, users have the ability to upload a document. The document is currently saved on the Web server in a temp directory. I need to move the uploaded file off the webserver and over to a specific directory on the file server. I have tried using File.Move to accomplish this but encountered permission errors. How does this need to be set up to work? The code format I have is File.Move ("c:\\dir\\file.ext", "\\\\fileserver\\dir\\file.ext"); Thanks in Advance ...

Why we use Web.Config File for connection string wether we can use class Library for get connection for whole web Application
 Why we use Web.Config File for connection string wether we can use class Library for get connection for whole web Application  please help me? Friend, Web.config has its own advantages. 1) Web.Config is used to store the important information like connections strings etc...so that it can be modified even after the code has been    deployed to the server without compiling the entire application again. 2) Since it is a XML file, there is no need of building the project of you are going to change the connection strings.   If you go for the class files,...

How to use 2 web.config file in a single web application
Hello Guyz,In my web application I'm trying to use a Blog and for that I'm using the free version of community server. The blog itself runs fine. But I'm trying to use it as a subdomain of my original application.The blog itself has its own web.config file as my application does and for that it's throws the following  errorParser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS. It'...

one application has many web.config files which web.config file execute first?
hi to all In my application i will add three web.config file which will execute first. how to set it. Give me a guidlines. by Devan.G Hi,You can't add multiple web.config to applicationYou can add single web.config to each folder present in sub directories of your applicationYou can override the web.config files using multiple config files.SatalajWatch The true story of internet ||Yet another forum |||I'm big fan of Open source flash chart for .net very very simple I n t e r v i e w T i p s Hi, You can check this reference: http://www.beansoftware.com/ASP.NET-Tutorials/Mult...

multiple file upload using my web form
Hi all. I work for a web company, and a website was built for a client, which lets the company that we built it for, upload images to their web server through the web page using a standard fileupload control. For each image they upload, some code in the background (vb .net) takes the details and adds the details to a database on the server, the loads the image to the server. On a regular basis they upload all their images this way, which can be hundreds of images! Is there a way for me to let them upload a folder full of images? This couldn't be an FTP job as code needs to work in the ...

how to upload a massive file(such as 1GMB) file using web browser ?thank you!
the control provided by asp.net only upload a small file,i want to use it to upload a massive file. set your timeout (for that page) to an insane number... like 5 days or something.Josh Withrowhttp://www.LuckyDogDigital.comhttp://Blog.LuckyDogDigital.com Hi hu58, My blog might give some info to you: http://weblogs.asp.net/coltk/archive/2004/02/06/FleskUploader.aspx Regards, ^-^...

File upload to a server other than the web server.
I have a very simple asp.net upload page. Everything works great when saving the file locally (web server). Things are getting ugly when trying to save files to a different machine (file server, database server,...) So, when using .SaveAs and passing in the UNC path to the new server location I get an *Access denied* error messgae. When mapping a network drive and using the drive letter in the .SaveAs path I get an message saying parts of the path cannot be found. any ideas? thanks  --tolgaApplication Developer Make sure that the account running asp.net web applicaiton(defa...

Web resources about - How to File Upload in file server by using web application C# - asp.net.web-forms

Application - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Would you give up chocolate for better application performance?
Application performance is critical to business performance according to 98 percent of businesses, yet 89 percent of executives say the poor ...

Gun Sales, Concealed Permit Applications Surge After San Bernardino
The day after Syed Farook and Tashfeen Malik opened fire in San Bernardino, gun sales and concealed carry permit applications surged.

MBA: Mortgage Applications Increase in Latest MBA Weekly Survey, Purchase Applications up 29% YoY
From the MBA: Mortgage Applications Increase in Latest MBA Weekly Survey Mortgage applications increased 1.2 percent from one week earlier, ...

Falling Costs, Rising Applications Will Boost US Energy Storage Market
... in 2013 to 3,659MWh by 2020 on improving economics and policy developments, predicted GTM Research's Shayle Kann Falling Costs, Rising Applications ...

Mortgage applications down 0.2%
Mortgage interest rates haven't moved much in the past three weeks, but they are holding at a higher level than for all of 2015.

California Film & TV Tax Credits Applications Dip In New Small Screen Round
With production on the uptick in the home of Hollywood , the second round of those seeking small screen Golden State tax credits saw 32 applications ...

Digitimes Research: China touch panel makers increasing investments in niche products and large-size ...
The China International Touchscreen Exhibition (C-Touch) was recently held in Shenzhen, China, featuring a number of local and international ...

Six internet-of-things applications in big new government trial
Manchester, England, is set to be the UK demonstrator city for internet-of-things innovation. Of course, there is much smart technology already ...

New patent application suggests Nintendo’s NX console is like nothing we’ve seen before
Nintendo has been close-mouthed about its plans for the Nintendo NX, but a recent patent filing may have tipped the company's hand. If so, then ...

Resources last updated: 12/13/2015 2:20:25 AM