Essential Tools ASP.NET
uploadBox
October 27, 2011 07:05 AM by Meena[Syncfusion]
emcek
uploadBox
October 14, 2011 09:36 AM
Hi,

1) is it possible to add one file only via uploadBox, I mean when I uploaded some file 'A' next time i'll use uploadBox, file 'A' should be replaced by file 'B'.

2) is it possible to hide uploaded files list (below Browse) permanently? Or render it on the right side of the button.


Jaffersathick B
[Syncfusion]
uploadBox
October 17, 2011 06:20 AM
Hi,

Thank you for using Syncfusion products.

Before I start proceeding to provide you the solution, I would like to know which platform you are looking for ASP.NET or ASP.NET MVC.
Also regarding your second query a screen shot of how you are looking for would be greatly helpful for us to provide the exact solution.

Regards,
Jaffer


Jaffersathick B
[Syncfusion]
uploadBox
October 17, 2011 06:20 AM
Hi,

Thank you for using Syncfusion products.

Before I start proceeding to provide you the solution, I would like to know which platform you are looking for ASP.NET or ASP.NET MVC.
Also regarding your second query a screen shot of how you are looking for would be greatly helpful for us to provide the exact solution.

Regards,
Jaffer


emcek
uploadBox
October 25, 2011 01:56 AM
Hi,

thanks for your fast answer, unfortunately I have been busy in another area.. I'm using mvc.net (razor). And i'm looking for something like on attached screenshot.

Regards,
McK



uploadBox_6a910baf.rar
Meena
[Syncfusion]
uploadBox
October 27, 2011 07:05 AM
Hi Emcek,

1.Your first requirement of replacing the existing file with a new file in Upload box could be achieved by inserting the following code snippet in the controller.


var fileName = Path.GetFileName(file.FileName);
string[] files = System.IO.Directory.GetFiles(Server.MapPath("~/Upload"));
foreach (string s in files)
{

System.IO.File.Delete(s);

}
var destinationPath = Path.Combine(Server.MapPath("~/Upload"), fileName);

file.SaveAs(destinationPath);



2.Your second requirement of placing the uploaded file list to the right of the Browse button could be achieved by setting the particular CSS properties.


[CSS]
.upload-file-list
{
margin-left:75px;
margin-top:-46px;
}


We have created a sample with Upload box and the same can be downloaded from the below

Let us know if you have any queries.

Regards,
Meena



Upload-Incident_f40307a1.zip
::adCenter::