| | |
Change File name while uploading
Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Aug 2008
Posts: 59
Reputation:
Solved Threads: 2
Hi..
I want to upload a file with help of FileUpload control, in which, i want to save the file with a specific name or say a name entered in a textbox on a same page.
for ex, if textbox contains "ABC" then the files should be uploaded with abc.jpg name.
how can i restrict user to select only specific types of file in a fileupload control?
also, how can i save an image in 3 different sizes at time of uploading?
when user selects an image, it should be saved in some specific size in a specified folder with the name as in textbox,,,
Thanks,
I want to upload a file with help of FileUpload control, in which, i want to save the file with a specific name or say a name entered in a textbox on a same page.
for ex, if textbox contains "ABC" then the files should be uploaded with abc.jpg name.
how can i restrict user to select only specific types of file in a fileupload control?
also, how can i save an image in 3 different sizes at time of uploading?
when user selects an image, it should be saved in some specific size in a specified folder with the name as in textbox,,,
Thanks,
•
•
Join Date: Nov 2009
Posts: 16
Reputation:
Solved Threads: 2
0
#7 27 Days Ago
Use this in your event handler for clicking an upload button.
ASP.NET Syntax (Toggle Plain Text)
if (FileUpLoad1.HasFile) { String fileName = "yourfilename"; FileUpload1.PostedFile.SaveAs(Server.MapPath("yourpath/") + fileName); }
•
•
Join Date: Mar 2008
Posts: 68
Reputation:
Solved Threads: 11
0
#9 26 Days Ago
try this
ASP.NET Syntax (Toggle Plain Text)
if (fuResume.HasFile) { string ext = System.IO.Path.GetExtension(fuResume.PostedFile.FileName); if (ext == ".doc" || ext == ".txt" || ext == ".rtf" || ext == ".pdf") { //do something here } }
got solution ?, please mark the thread as Solved. Thanks & Regards,srikanth kadem
srikanthkadem@rediffmail.com
![]() |
Similar Threads
- Change the file stream object's read position in C++. (C++)
- Change the name of a file getting downloaded (JavaScript / DHTML / AJAX)
- Need help slurping not able to change the file (Perl)
- File uploading errors (PHP)
- Product Catalogue in ASP.net 2.0 and MS access (ASP.NET)
- Having user change file locations (Python)
- how to change file name? (VB.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: Anybody Aware of Adobe Flex
- Next Thread: Calculation Event in C#?
| Thread Tools | Search this Thread |
.net 2.0 activexcontrol advice ajax alltypeofvideos application asp asp.net bc30451 bottomasp.net box browser button c# c#gridviewcolumn checkbox click commonfunctions confirmationcodegeneration css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock development dgv dropdownlist dynamically edit expose feedback fileuploader fill flash form formatdecimal forms formview grid gridview gudi homeedition hosting iframe iis javascript jquery listbox login microsoft mono mouse mssql multistepregistration news numerical objects opera panelmasterpagebuttoncontrols parent radio redirect registration relationaldatabases reportemail rotatepage save schoolproject search security select silverlight smartcard smoobjects software sql-server sqlserver2005 suse textbox tracking unauthorized validation vb.net video videos view virtualdirectory vista visualstudio web webapplications webdevelopemnt webprogramming webservice xml xsl youareanotmemberofthedebuggerusers





