Results 1 to 15 of 15

Thread: UpLoad Resume

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2008
    Posts
    474

    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?

  2. #2
    Hyperactive Member dnanetwork's Avatar
    Join Date
    Oct 2007
    Location
    Mumbai
    Posts
    349

    Thumbs up Re: UpLoad Resume

    Quote Originally Posted by sonia.sardana View Post
    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..

  3. #3
    Hyperactive Member dnanetwork's Avatar
    Join Date
    Oct 2007
    Location
    Mumbai
    Posts
    349

    Thumbs up 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

  4. #4
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2008
    Posts
    474

    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???????

  6. #6
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    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.
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2008
    Posts
    474

    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????

  8. #8
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: UpLoad Resume

    While saving the files add the datetime stamp to the name so that there is no duplication.
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  9. #9
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    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:
    1. Private ValidFileTypes() As String = {"text/plain", "application/msword"} '<-- Add more valid filetypes here
    2.  
    3. Private Sub UploadFile()
    4.     '' check if we support this file format
    5.     If validFileTypes.Contains(FileUpload1.PostedFile.ContentType) Then
    6.         '' Upload file to server
    7.         Dim FileName As String
    8.         FileName = String.Format("{0:yyyyMMddHHmmssff}-{1}", Now, FileUpload1.FileName)
    9.         FileUpload1.SaveAs("C:\Temp\" & FileName)   '<-- replace with appropriate path
    10.  
    11.         '' make approrpiate entry about this filename etc. into the database here
    12.  
    13.         Response.Write("File upload successful.")  
    14.     Else
    15.         Response.Write("This file type is not supported by our website.")  
    16.     End If
    17. End Sub
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  10. #10
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  11. #11
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: UpLoad Resume

    Quote Originally Posted by gep13 View Post
    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.
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  12. #12
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  13. #13
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    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.
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  14. #14
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  15. #15
    Frenzied Member brin351's Avatar
    Join Date
    Mar 2007
    Location
    Land Down Under
    Posts
    1,293

    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
  •  



Click Here to Expand Forum to Full Width