Click here to Skip to main content
15,921,351 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: differnce between Pin
_AK_13-Jun-07 20:18
_AK_13-Jun-07 20:18 
AnswerRe: differnce between Pin
Sathesh Sakthivel13-Jun-07 20:21
Sathesh Sakthivel13-Jun-07 20:21 
AnswerRe: differnce between Pin
Venk25913-Jun-07 20:22
Venk25913-Jun-07 20:22 
QuestionSession help Pin
kvijayajyothy13-Jun-07 20:05
kvijayajyothy13-Jun-07 20:05 
QuestionScript Pin
saravraj13-Jun-07 19:58
saravraj13-Jun-07 19:58 
AnswerRe: Script Pin
sPaudel13-Jun-07 22:14
sPaudel13-Jun-07 22:14 
QuestionProblem when using SSL certificates.. Pin
vijay_8313-Jun-07 19:33
vijay_8313-Jun-07 19:33 
QuestionFile Upload using Html Input control Pin
sudidelaravindra13-Jun-07 19:12
sudidelaravindra13-Jun-07 19:12 
Hi,
I have implemented file uploading using Html Input control by means of client call back.It is working fine when tested loaclly.But in server it's not working.As i have done using client call back, i can not able to access the Input control in the code behind.So i couldn't able to access the
"SaveAs(string path)" method which will take care of saving the file to the webserver at the path specified in the argument of "Save()".

In my application i have written my own way of saving files to the webserver
at the path specified.Here is my code...
public string Attach(string p_path)
{
Boolean fileOK = false;
String path = Server.MapPath("~/Temp/");
FileInfo l_file = new FileInfo(p_path);
if (l_file.Exists)
{
String fileExtension = l_file.Extension.ToLower();
String[] allowedExtensions = { ".gif", ".png", ".jpeg", ".jpg", ".doc", ".txt", ".mp3", ".rm", ".wav" ,".pdf" ,".xls" };
for (int i = 0; i < allowedExtensions.Length; i++)
{
if (fileExtension == allowedExtensions[i])
{
fileOK = true;
}
}

}
if (fileOK)
{
try
{
l_file.CopyTo(path + l_file.Name);
string labelText = "File uploaded!";
return "J" + labelText + "^" + l_file.Name + "^" + p_path;
}
catch (Exception ex)
{
string labelText = "File could not be uploaded.";
return "Z" + labelText;
}
}
else
{
string labelText = "Cannot accept files of this type.";
return "Z" + labelText;
}
}

In the above code

p_path is the path of the file at the client side that is attached to the server.
Temp is the folder that we created in our application to which files are to be saved.


if (l_file.Exists)
{
}
l_file.Exists is returning false and "Cannot accept files of this type." is the message that i am getting.
QuestionEncryption and Decryption of username and password in asp.net Pin
jai 12313-Jun-07 19:00
jai 12313-Jun-07 19:00 
AnswerRe: Encryption and Decryption of username and password in asp.net Pin
amin_behzadi13-Jun-07 20:22
professionalamin_behzadi13-Jun-07 20:22 
QuestionCheckedBoxList Pin
Rajiya13-Jun-07 18:59
Rajiya13-Jun-07 18:59 
AnswerRe: CheckedBoxList Pin
Chetan Ranpariya13-Jun-07 20:38
Chetan Ranpariya13-Jun-07 20:38 
AnswerRe: CheckedBoxList Pin
saravraj13-Jun-07 21:21
saravraj13-Jun-07 21:21 
QuestionSystem.IndexOutOfRangeException: There is no row at position 0 Pin
Sophia Rekhi13-Jun-07 18:58
Sophia Rekhi13-Jun-07 18:58 
AnswerRe: System.IndexOutOfRangeException: There is no row at position 0 Pin
Venkatesh Mookkan13-Jun-07 19:41
Venkatesh Mookkan13-Jun-07 19:41 
GeneralRe: System.IndexOutOfRangeException: There is no row at position 0 Pin
Sophia Rekhi13-Jun-07 19:56
Sophia Rekhi13-Jun-07 19:56 
GeneralRe: System.IndexOutOfRangeException: There is no row at position 0 Pin
Venkatesh Mookkan13-Jun-07 20:05
Venkatesh Mookkan13-Jun-07 20:05 
GeneralRe: System.IndexOutOfRangeException: There is no row at position 0 Pin
Sophia Rekhi13-Jun-07 20:30
Sophia Rekhi13-Jun-07 20:30 
GeneralRe: System.IndexOutOfRangeException: There is no row at position 0 Pin
Venkatesh Mookkan13-Jun-07 20:41
Venkatesh Mookkan13-Jun-07 20:41 
Questionencrypt the coookies Pin
saravanan0513-Jun-07 18:13
saravanan0513-Jun-07 18:13 
AnswerRe: encrypt the coookies Pin
Sylvester george13-Jun-07 18:28
Sylvester george13-Jun-07 18:28 
QuestionRe: encrypt the coookies Pin
saravanan0513-Jun-07 19:11
saravanan0513-Jun-07 19:11 
AnswerRe: encrypt the coookies Pin
Sylvester george13-Jun-07 19:24
Sylvester george13-Jun-07 19:24 
GeneralRe: encrypt the coookies Pin
saravanan0513-Jun-07 20:08
saravanan0513-Jun-07 20:08 
AnswerRe: encrypt the coookies Pin
Sathesh Sakthivel13-Jun-07 19:29
Sathesh Sakthivel13-Jun-07 19:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.