save the filepath in database to get it back

Jan 12, 2009 at 5:02 AM
Edited Jan 12, 2009 at 5:03 AM
Hi,
I'm developing a job portal and I want to use Fileupload Ajax   controlto upload resumes. I want that when a user uploads Resume(.txt/.doc/.pdf) user gets to see the file along with other form elements as well as save the resume path in a database field so that the user gets access to modify his/her resume when he/she visits the site next time. Can anyone tell me how can I achieve this with this control?
Thanks in advance.
shraddha
Feb 6, 2009 at 6:40 AM
R u still looking for an answer??
Feb 6, 2009 at 6:48 AM
Hi orangecrush,
Though I'm now planning to use asp.net fileuplaod control with saving the CV in a folder and saving the resume name in the database along with resume ID..I'll be highly obliged if you can answer my above question..using fileuploader ajax.
thanks in advance
shraddha
Feb 6, 2009 at 6:50 AM
Hi orangecrush,
Though I'm now planning to use asp.net fileuplaod control with saving the CV in a folder and saving the resume name in the database along with resume ID..I'll be highly obliged if you can answer my above question..using fileuploader ajax.
thanks in advance
shraddha
Feb 6, 2009 at 7:40 AM
Edited Feb 6, 2009 at 7:42 AM

Steps to follow: -
1] save ur file to ur Resume folder.
if (ImageUpload.IsPosting)
{
.HttpPostedFileAJAX pfa = ImageUpload.PostedFile;
 if ((pfa.ContentType.Equals("image/gif") || pfa.ContentType.Equals("image/jpeg") || pfa.ContentType.Equals("image/pjpeg") ||   pfa.ContentType.Equals("image/png") || pfa.ContentType.Equals("image/x-png")) && pfa.ContentLength <= 100 * 1024)
             ImageUpload.SaveAs("~/Resume", pfa.FileName);
}

2] also save the record to ur DB - u do have the filename [pfa.FileName] and assuming all de resumes go into the same folder, u can easily display the same wenever a user is looking to edit.

I hope this is wwat u r looking at. Let me know if u r looking for something else.    
Feb 6, 2009 at 7:48 AM
Hi orangecrush,
thanks for your reply..I'll really be benefited from it but I have one problem..what should I do..when there are multiple resumes with the same name..since two people can have same name..and the resumes are getting saved in the same folder..if I try rename it would not be correct and moreover it can create problem while updations..etc!!
thanks in advance
shraddha
Feb 6, 2009 at 7:58 AM
i believe each user has a unique user id, which culd be appended to de filename, if de same user uploads another file either u culd over-write the existing or if a user has permission to upload multiple resumes, then u culd hv another DB table as well, mapping user ids wid de resumes uploaded. u culd hv a unique resume_id in this case.