Click here to Skip to main content
12,885,784 members (44,335 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP Javascript jQuery
Dear Friends,

I working on one page which is in Classic ASP.
I want include a file upload option in it and want to store the uploaded file in a folder.
I am planning to use jQuery for the same.
Kindly suggest is it good option or any better option is there.
Posted 7-Oct-12 18:20pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

/*Store Folder path */
hdfUploadPath.Value = "Folder Path where you want to store your file"+ "\\";

/*Creating Directory*/
if (!Directory.Exists(hdfUploadPath.Value))

/*To get user uploaded file name*/
UploadedFile filename = UploadID.UploadedFiles[0];//"UploadID" is FileUpload ID
strGetFileName = filename.GetName();

/*Path to save user uploaded file*/
string strFileName = hdfUploadPath.Value + strGetFileName;

/*existence of file if not exists then saving else giving message to user*/
if (!File.Exists(strFileName))
filename.SaveAs(strFileName, true);
ScriptManager.RegisterStartupScript(this, this.GetType(), "Error", "alert('File already exist or rename file then upload');", true);
Arunprasath Natarajan 8-Oct-12 1:35am
Seems to be C#, Is it Classic ASP.
If no, since the existing pages are in Classic ASP, I want to do it in same.
sanjaygajera123 17-Dec-12 12:49pm
Dear expert,
i want to upload file using ASP programming .
i have tried below code for file save on the server but it gives me an error,

Set Upload = Server.CreateObject("Persits.Upload")
Upload.SetMaxSize 1048576 ' Truncate files above 1MB
Upload.Save Server.MapPath("/upload/")


above code throws an error of Object creation.

please give the solution as soon as possible.

sanjay gajera
+91 89050 74894

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 8 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100