This is a migrated thread and some comments may be shown as answers.

initiate upload when button is clicked

1 Answer 59 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
sadiqabbas
Top achievements
Rank 1
sadiqabbas asked on 08 Feb 2010, 07:10 AM
hi all

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

e.g.
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

1 Answer, 1 is accepted

Sort by
0
Vesko
Top achievements
Rank 2
answered on 10 Feb 2010, 04:17 PM
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.


Tags
Upload (Obsolete)
Asked by
sadiqabbas
Top achievements
Rank 1
Answers by
Vesko
Top achievements
Rank 2
Share this question
or