initiate upload when button is clicked

Thread is closed for posting
2 posts, 0 answers
  1. sadiqabbas
    sadiqabbas avatar
    21 posts
    Member since:
    Mar 2009

    Posted 08 Feb 2010 Link to this post

    hi all

    i am using radupload in my webform
    i want to initiate upload after some process to happen

    i am having a database named dataemp
    in that a table tb1
    having fields
    id = auto number
    name = text
    address = text
    photodir = text
    photoname = text

    now what i want to do is that after filling form
    name: textbox
    address: textbox
    photo: radupload

    when user fills the form
    after that he clicks submit button
    at that time
    insert name and address in database
    get id from dataemp.tb1

    and then in picture directory at server i want to create a directory named id(fetched from dataemp.tb1)
    and then i want radupload to upload file in that directory i.e picture/<id>/

    all of the things i have done but having some problem that process flow should be
    1. insert into database
    2. get id from database
    3. create dir
    4. initiate upload

    please needed help ASAP
  2. Vesko
    Vesko avatar
    122 posts
    Member since:
    Mar 2009

    Posted 10 Feb 2010 Link to this post

    Let's say you submit the form with a Button and you have subscribed to the Button_Click event.

    There you create your connection to the database and execute the INSERT query. After the insert query you might select @@identity which will return the ID of the inserted record.

    Next, you create the folder and after that use the SaveAs() method of the UploadedFile object.

Back to Top