|
-
Oct 26th, 2009, 08:28 AM
#1
Thread Starter
Hyperactive Member
UpLoad Resume
I want to upload the resume into SQL server from ASP.net. I want to just upload the doc files.Can somebody give idea,how to do that?
-
Oct 26th, 2009, 09:29 AM
#2
Hyperactive Member
Re: UpLoad Resume
 Originally Posted by sonia.sardana
I want to upload the resume into SQL server from ASP.net. I want to just upload the doc files.Can somebody give idea,how to do that?
fileupload control..
and do check on extension..
i hope that's easy..
else
i'll give you the code..
-
Oct 26th, 2009, 09:50 AM
#3
Hyperactive Member
Re: UpLoad Resume
Code:
protected void Button1_Click(object sender, EventArgs e)
{
String fileExtension = System.IO.Path.GetExtension(FileUpload1.FileName).ToLower();
//Response.Write(fileExtension.ToString());
if (fileExtension.ToString() == ".doc")
{
try
{
FileUpload1.SaveAs(Server.MapPath("~/DOCS/" + FileUpload1.FileName.ToString()));
Response.Write("File Uploaded Successfully..");
}
catch (Exception ex)
{
Response.Write("Your Error" + ex.Message.ToString());
}
}
else
{
Response.Write("Please Upload Only DOC files..");
}
}
this will do ...if not let me know exception...
hope that helps
-
Oct 26th, 2009, 09:58 AM
#4
Re: UpLoad Resume
Hey sonia,
Can you perhaps provide some more information as to your exact requirement? Are you allowing people to log into your website? Do you need to relate the resume that is being uploaded to their user profile? Or are they simply being uploaded, and someone is being notified of the upload?
Here is the documentation for the FileUpload Control:
http://msdn.microsoft.com/en-us/libr...ileupload.aspx
Gary
-
Oct 26th, 2009, 01:50 PM
#5
Thread Starter
Hyperactive Member
Re: UpLoad Resume
hello gep Sir, I m developing a job site on which users can upload resume. I think so that resume is saved in DATABASE na???If i m not wrong or u advice me what to do???????
-
Oct 26th, 2009, 02:25 PM
#6
Re: UpLoad Resume
There are various file formats a user can choose to build and upload his resume. Everyone doesnot have doc editors (e.g. Ms Word etc.) on their system. So they may also choose to save it as plain text file (*.txt), or in rich text format (.rtf), *.pdf etc.
I suggest you allow most formats except for executable formats like *.exe, *.bat, *.vbs, *.js etc. which are dangerous.
Moreover, if you accept files and do nothing with it, it's useless. You can't search anything in them (programatically) as each resume will be in different format. So storing them in a database don't do much good. What most job websites do is accept file from user;The file then goes to a data-entry operator who fills the various elements of the resume into the database using the data-entry screen provided. This data is now well formatted and can be queried using sql queries.
-
Oct 26th, 2009, 03:03 PM
#7
Thread Starter
Hyperactive Member
Re: UpLoad Resume
Hello thx to all.
I save the resumes that are uploaded ,in a folder. Suppose I save all the resume in Server.MapPath(~Users/Resumes) Folder. Suppose first user selects file C:\Resume.doc. Now on File Upload- File named Resume.doc,save to my Resumes Folder. Now suppose second user selects file D:\Resume.doc,In that case what to do??? First file is overwritten by the user???? So what to do to avoid this????? Check the FileNames????
-
Oct 26th, 2009, 09:24 PM
#8
Re: UpLoad Resume
While saving the files add the datetime stamp to the name so that there is no duplication.
-
Oct 26th, 2009, 09:57 PM
#9
Re: UpLoad Resume
Do something like this sample. (Note that I used Response.Write to show the status for demo purposes; however the ideal way is to show it in label etc.)
vb.net Code:
Private ValidFileTypes() As String = {"text/plain", "application/msword"} '<-- Add more valid filetypes here Private Sub UploadFile() '' check if we support this file format If validFileTypes.Contains(FileUpload1.PostedFile.ContentType) Then '' Upload file to server Dim FileName As String FileName = String.Format("{0:yyyyMMddHHmmssff}-{1}", Now, FileUpload1.FileName) FileUpload1.SaveAs("C:\Temp\" & FileName) '<-- replace with appropriate path '' make approrpiate entry about this filename etc. into the database here Response.Write("File upload successful.") Else Response.Write("This file type is not supported by our website.") End If End Sub
-
Oct 27th, 2009, 02:15 AM
#10
Re: UpLoad Resume
Hey,
As an alternative suggestion, you might want to think about appending the IP address of person who is logged in and uploading the file to the name.
I agree with Pradeep on the location of the uploaded files. I don't see any benefit in storing them in the database. Upload them into one place, and place a "pointer" to the file in the database.
Gary
-
Oct 27th, 2009, 03:16 AM
#11
Re: UpLoad Resume
 Originally Posted by gep13
Hey,
As an alternative suggestion, you might want to think about appending the IP address of person who is logged in and uploading the file to the name.
I agree with Pradeep on the location of the uploaded files. I don't see any benefit in storing them in the database. Upload them into one place, and place a "pointer" to the file in the database.
Gary
I doubt if appending IP Address to the filename would help generate unique filename. What if the same person uploads two files with same name?
You may however store the IP address in your database along with filename, filetype etc. in your database for later use.
-
Oct 27th, 2009, 03:20 AM
#12
Re: UpLoad Resume
Hey,
In terms of the same person uploading two files, then in this case, I would expect an overwrite to happen, since why would the same person have two resume's? An upload of the same filename would be regarded as an update to the resume.
Gary
-
Oct 27th, 2009, 03:46 AM
#13
Re: UpLoad Resume
Most of the job sites now allow more than one resume profile for each person. e.g. When I'm applying for a Project Manager, I might want to format my resume differently than what I would do for Software Developer etc.
-
Oct 27th, 2009, 04:01 AM
#14
Re: UpLoad Resume
Hey,
Ah, that's a good point.
Just shows my lack of knowledge in that area, I have never used a Online Resume site 
Gary
-
Oct 27th, 2009, 04:16 AM
#15
Re: UpLoad Resume
Personally I would make job seekers paste their resume into a rich text editor apply some formatting and save it as a text field in the database or a pdf file or whatever. That way you control the format/ type of file.
Maybe that's to much effort to go to though, just a suggestion.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|