ASP.NET - Unable to upload file using ASP.net webservices.  ASP.NET - Unable to upload file using ASP.net webservices.

Asked By Hari
12-Apr-11 07:24 AM

Even if the file is on desktop, it is throwing an error like ' Could not find the file'.
  James H replied to Hari
12-Apr-11 07:32 AM
Hi ,
Please check this link .
http://www.c-sharpcorner.com/uploadfile/scottlysle/uploadwithcsharpws05032007121259pm/uploadwithcsharpws.aspx

Try this and let me know
  Hari replied to James H
12-Apr-11 08:08 AM

  Hi Hemanth,

  thank you for the reply. I have tried the same code.

String strFile = System.IO.Path.GetFileName(filename);


I want to get the entire path of the uploading file.
please tell me how to do that.
Im new to dot net.
  James H replied to Hari
12-Apr-11 08:19 AM
use this snippet

String strFile = System.IO.Path.GetFullPath(filename);

  Hari replied to James H
12-Apr-11 08:31 AM

upload button click:

protected void Button1_Click(object sender, EventArgs e)

{

if (FileUpload1.HasFile)

{

UploadFile(FileUpload1.FileName);

}

}

private void UploadFile(string filename)

{

try

{

String strFile = System.IO.Path.GetFullPath(filename);

TextBox1.Text = strFile;
}

Even when Im uploading any file from Desktop, always the highlighted path is being shown.
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Scrum_05-04 _A.XLS

Even when Im uploading any file from Desktop, always the highlighted path is being shown.\Scrum_05-04 _A.XLS

Create New Account
help
string tmpEntry = String.Empty; while ((theEntry = s.GetNextEntry()) ! = null) { string directoryName = outputFolder; string fileName = Path.GetFileName(theEntry.Name); / / create directory if (directoryName ! = " ") { Directory.CreateDirectory(directoryName); } if (fileName ! = String.Empty) { if (theEntry else { break ; } } streamWriter.Close(); } } } s.Close(); if (deleteZipFile) File.Delete(zipPathAndFile); } } } You can dowload the Visual Studio 2008 Solution , which includes a Windows Forms "Tester" app that allows you to test the any validation on the various textboxes, File and Folderbrowser dialogs. If you do not have Visual Studio 2008, just make a new blank solution and add the project files to it. Popularity the best alternative in your opinion? I need to take photos and files in an ASP.NET app from a database and combine in a zip file for download to the user PM See this posting at Codeplex to help with this as of late http: / / weblogs.asp.net / jgalloway / archive / 2007 / 10 / 25 / creating-zip-archives-in-net-without-an-external-library
visual studio installation problem Actually, my OS is Windows Xp with service pack2.I added service pack3 to install visual studio2010.after that i tryed to installed, but am getting SETUP FAILED due to "Windows XP is not installed. [08 / 10 / 11, 14:26:00] VS70pgui: [2] DepCheck indicates Microsoft Visual F# 2.0 Runtime was not attempted to be installed. [08 / 10 / 11, 14:26:00] VS70pgui: [2] DepCheck indicates Microsoft Visual Studio Macro Tools was not attempted to be installed. [08 / 10 / 11, 14:26:00] VS70pgui attempted to be installed. [08 / 10 / 11, 14:26:01] VS70pgui: [2] DepCheck indicates Microsoft Visual Studio 2010 Professional - ENU was not attempted to be installed. [08 / 10 / 11, 14:26:01
Microsoft.Jet.OLEDB.4.0;”+ _ “Data Source = C: \ Documents and Settings \ User \ My Documents \ Visual Studio Projects \ 1209 \ db1.mdb”+ _ “User ID = Admin;”+ _ “Password = ;”); Dim cmd As New OleDbCommand in Sql server as var_name int How do you separate business logic while creating an ASP.NET application? There are two level of asp.net debugging 1. Page level debugging For this we have to edit the page level debugging the corresponding date and time written Steps are:- Creating a CalenderControl 1) To begin, open Visual Studio .NET and begin a new C# Windows Control Library. 2) You may name it whatever
Net hi friends Any one send frequently asked Important questions in C# .Net, ADO .Net, Asp .Net and Sql Server. . . . . . . . tx in Advance. . . . . . Hi, Find this. . (B)What is an IL? (B A) What is scavenging? (B) What are different types of caching using cache object of ASP.NET? (B) How can you cache different version of same page using ASP.NET cache object? (A) How will implement Page Fragment Caching? (B) Can you compare ASP.NET sessions with classic ASP? (B) Which are the various modes of storing ASP.NET session