Click here to Skip to main content
16,005,316 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: GridView Calculation Pin
decokin20-Sep-08 21:34
decokin20-Sep-08 21:34 
Question.Net framework in windows 98 Pin
Ravi_2128-Nov-07 19:27
Ravi_2128-Nov-07 19:27 
AnswerRe: .Net framework in windows 98 Pin
Christian Graus28-Nov-07 19:30
protectorChristian Graus28-Nov-07 19:30 
GeneralRe: Benefit of make the business layer class as sealed class Pin
Michael Sync28-Nov-07 19:24
Michael Sync28-Nov-07 19:24 
GeneralRe: Benefit of make the business layer class as sealed class Pin
hogan.smith28-Nov-07 19:47
hogan.smith28-Nov-07 19:47 
GeneralRe: Benefit of make the business layer class as sealed class Pin
N a v a n e e t h28-Nov-07 19:52
N a v a n e e t h28-Nov-07 19:52 
GeneralRe: Benefit of make the business layer class as sealed class Pin
hogan.smith28-Nov-07 21:16
hogan.smith28-Nov-07 21:16 
QuestionUploading Multiple Files.... Pin
pavya_Cool28-Nov-07 19:23
pavya_Cool28-Nov-07 19:23 
Hi to All,

Here i am trying to upload multiple files on a server. This works fine for the files having size less than 4 to 5 MB, but whenever i trying to upload the file whos size is more than that it even does not take that file. Here i am using a List box to contain the files to be uploaded. the code for "add files" and "upload files" as follows....


//code for Add file Button
private void AddFile_Click(object sender, System.EventArgs e)
{
lblStatus.Visible=true;
lblStatus.Text="";
//call to HideControl()
HideControls(1);
bool b=true;

if (Page.IsPostBack == true)
{
listFileList.AutoPostBack=true;

// This function adds the selected files in the List Box.
// if the file is not selected then it dispalyes the error message.
// Check for the availability of the files in the FindFile control.
if (FindFile.Value!="")
{
if (listFileList.Items.Count!=0)
{
for (int i=0; i<listfilelist.items.count; i++)
="" {
="" b="true;
" if="" (findfile.postedfile.filename="=" convert.tostring(listfilelist.items[i]))
="" lblstatus.text="File already present in listbox" ;
="" break;
="" }
="" (b="=" true)
="" hif.add(findfile);
="" listfilelist.items.add(findfile.postedfile.filename);
=""
="" else
="" }="" end="" of="" if-else.
=""

="" sets="" the="" upload="" button="" caption
="" (listfilelist.items.count="">1)
Upload.Text= "Upload All";
else
Upload.Text= "Upload File";

listFileList.AutoPostBack=true;
}// end of AddFile_Click()





// Code for Upload file button
private void Upload_Click(object sender, System.EventArgs e)
{
if (!IsPostBack==false)
{
HideControls(1);
//string stat1="";
string baseLocation = Server.MapPath("~/Files/Upload/");
string status = "";
if((listFileList.Items.Count == 0) && (filesUploaded == 0))
{
lblStatus.Text = "Error - a file name must be specified.";
return;
}// end of if
// call to CheckUploadFile() to check availability of the details of specified file
CheckUploadFile();
// if details of all files available then only it uploads these files
if (stat == "")
{
HtmlInputFile HIF = new HtmlInputFile();
foreach(System.Web.UI.HtmlControls.HtmlInputFile HIF1 in hif)
{
string fn = ln + "-" + System.IO.Path.GetFileName(HIF1.PostedFile.FileName);
if (File.Exists(baseLocation+fn)==false)
{
HIF1.PostedFile.SaveAs(baseLocation + fn);
UpdateCheck(fn, j);
filesUploaded++;
status += fn + "
";
}
else
{
filesExists++;
stat1 += fn + "
";
}
j++;
}// end of foreach
}
// else it will shows the error message
else
{
lblStatus.Text = "The details for following file(s) were not available. Please enter the details & try again.:
" + stat;
stat = "";
return;
}//end of if-else
// after uploading all the files it shows the summary
if(filesUploaded == hif.Count)
{
lblStatus.Text = filesUploaded + " file(s) were uploaded:
" + status;


}//end of if
else
{
lblStatus.Text = filesUploaded + " file(s) were uploaded:
" + status + "
" + filesExists + " File already exist(s).....
" + stat1;
stat1="";

}
hif.Clear();
listFileList.Items.Clear();
}
}// end of Upload_Click()




Any body tell me what is the problem...?


Pravin

AnswerRe: Uploading Multiple Files.... Pin
Michael Sync28-Nov-07 19:36
Michael Sync28-Nov-07 19:36 
Questiontext editor Pin
mukesh.mr0328-Nov-07 19:08
mukesh.mr0328-Nov-07 19:08 
AnswerRe: text editor Pin
Sun Rays28-Nov-07 19:17
Sun Rays28-Nov-07 19:17 
GeneralRe: text editor Pin
mukesh.mr0328-Nov-07 19:54
mukesh.mr0328-Nov-07 19:54 
AnswerRe: text editor Pin
Michael Sync28-Nov-07 19:49
Michael Sync28-Nov-07 19:49 
GeneralRe: text editor Pin
mukesh.mr0328-Nov-07 19:56
mukesh.mr0328-Nov-07 19:56 
QuestionRead and write pagemaker files in ASP.NET/C# Application Pin
gopalanmani28-Nov-07 19:03
gopalanmani28-Nov-07 19:03 
GeneralRe: Read and write pagemaker files in ASP.NET/C# Application Pin
Srinivas Kiran Das6-Jun-12 19:00
Srinivas Kiran Das6-Jun-12 19:00 
AnswerRe: Read and write pagemaker files in ASP.NET/C# Application Pin
sridharnetha22-Jul-14 5:27
sridharnetha22-Jul-14 5:27 
Questionrearding error Pin
GaneshKumarVkm28-Nov-07 18:54
GaneshKumarVkm28-Nov-07 18:54 
AnswerRe: rearding error Pin
Michael Sync28-Nov-07 19:18
Michael Sync28-Nov-07 19:18 
GeneralRe: rearding error Pin
GaneshKumarVkm28-Nov-07 19:20
GaneshKumarVkm28-Nov-07 19:20 
GeneralRe: rearding error Pin
Michael Sync28-Nov-07 19:29
Michael Sync28-Nov-07 19:29 
QuestionWhen i press enter key in textbox control ,buttons event gets called. Pin
coolsatty28-Nov-07 18:47
coolsatty28-Nov-07 18:47 
Question[Message Deleted] Pin
coolsatty28-Nov-07 18:46
coolsatty28-Nov-07 18:46 
AnswerRe: When i press enter key in textbox control ,buttons event gets call Pin
Michael Sync28-Nov-07 19:00
Michael Sync28-Nov-07 19:00 
AnswerRe: When i press enter key in textbox control ,buttons event gets call Pin
_AK_28-Nov-07 19:12
_AK_28-Nov-07 19:12 

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.