vb creating a unique id for insert form

We have a application within our office and we have recently been asked by a customer to facilitate the process of sending us data by providing an online portal whereby the information they send will be input directly in to our inhouse app (SQL server).

I have created an ASP.NET/VB application and created an input form. You dont need to log in or anything just navigate to the form, fill it in and then submit.
I have got the form working and once the required fields are completed you can click submit and my code uses an sql insert statement to input the data in to our sql server.

The problem is I also ask the user to upload several pictures. There are 4 tickboxes and when you tick each box there is an ajax file uploader.
The problem at the moment is all the images go in to a temporary folder and if more than one person is filling out the form at once that is a huge problem.

How can I assign a unique id to the page impression so I can in turn create a temp dir with the session id as its name - then once the insert statement has been made I can move the images to a new folder and delete the temporary one.
Who is Participating?
HainKurtConnect With a Mentor Sr. System AnalystCommented:
then use session id to create a temp folder
it is a unique id created by your web server
use this, create a temp folde rwith this name and upload here (each user will have different files in seperate folder)
HainKurtConnect With a Mentor Sr. System AnalystCommented:
create an id field in your table
whenever you insert data use
to get the last id inserted

then use this number to rename your temp files... or create a folder like this...

better you should use a stored procedure/function to insert the data

create procedure insData(... params here ...) as
  insert into myData (...columns here...) values(...params here...);

so, use this sp and get return value, create a temp folder, upload here, then use rename, move, delete...
amgrobinsAuthor Commented:
the problem is I want to upload the files before the form is submitted (i.e before the sql insert).
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.