Blocking multiple image uploads

Blocking multiple image uploads

am 27.12.2006 12:31:38 von Joja

Im uploading images to server db and each user can have just one picture.
User can fill his data and choose his picture ( normal signup with image
upload ).

The problem is that im loading upload file in new window ( not in signup
window ) so i can not control how many uploads are made.When the user clicks
upload button, photo is saved in the db.

How to block user to make multiple image uploads.?

Re: Blocking multiple image uploads

am 27.12.2006 18:05:45 von Shion

Joja wrote:
> Im uploading images to server db and each user can have just one picture.
> User can fill his data and choose his picture ( normal signup with image
> upload ).
>
> The problem is that im loading upload file in new window ( not in signup
> window ) so i can not control how many uploads are made.When the user clicks
> upload button, photo is saved in the db.
>
> How to block user to make multiple image uploads.?

You could have a column which is the userid and set it UNIQUE, before
inserting the image to the database, check if there is a such user, if not use
INSERT, if yes use UPDATE.

--

//Aho

Re: Blocking multiple image uploads

am 28.12.2006 16:27:40 von Joja

> You could have a column which is the userid and set it UNIQUE, before
> inserting the image to the database, check if there is a such user, if not
use
> INSERT, if yes use UPDATE.
-----------------------------------------
hmmmm, this could be a bit of a problem or i have understand this wrong.


signup form is in one window -- data is inserted into
signup table
upload page is loaded in second window -- data is inserted into picture
table

Both pages have nothing in common accept that on the signup page you can
find upload button and place for uploaded picture. After you click upload
button, new window is opened and on that window you can make upload.

***************
The main idea was to let user make the upload ( from the new window ), close
that new window and display this uploaded photo in the signup formular.
After signup is over, user would send all his data (including photo ) to the
db.
***************

Problem is that the photo is uploaded to db, _before_ the user registration
and then i can not know which photo belongs to which user....

Re: Blocking multiple image uploads

am 28.12.2006 20:48:45 von Shion

Joja wrote:
>> You could have a column which is the userid and set it UNIQUE, before
>> inserting the image to the database, check if there is a such user, if not
> use
>> INSERT, if yes use UPDATE.
> -----------------------------------------
> hmmmm, this could be a bit of a problem or i have understand this wrong.
>
>
> signup form is in one window -- data is inserted into
> signup table
> upload page is loaded in second window -- data is inserted into picture
> table
>
> Problem is that the photo is uploaded to db, _before_ the user registration
> and then i can not know which photo belongs to which user....

Store the image temporarily on the harddrive with the session value and insert
it into the image table first after the registration is finished.

If I had been you, I had made a file-select option in the sign-up form, where
those who sign-up can select the image they want to upload, with other words
skip the sing-up-upload-page. If they would have selected the wrong image,
they can always change that, right?

--

//Aho