Re: mysql and file upload problems
| From: | Robert Weeks | Date: | Sun, 10 Mar 2002 03:27:10 +0000 |
| Subject: | Re: mysql and file upload problems | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-17595@lists.php.net to get a copy of this message | ||
Why don't you just do the sql insert *after* the file upload function?:
Pseudocode:
if( NOT file upload attack, wrong file type, etc.){
//copy the file to the permanaent location
//call function to insert file details into the database
}
else{
//echo error to user
}
On 3/9/02 10:21 AM, "Carl E Shmidt" <lanvaledsl@earthlink.net> wrote:
> I have a standard multipart/enc form to allow users to upload files.
> Pseudocode:
> //call function to insert file details into the database
> if( NOT file upload attack, wrong file type, etc.){
> //copy the file to the permanaent location
> }
> else{
> //delete the record of file details from the database
> }
>
> I can have the file upload successfully, and the record is inserted into the
> database. The problem is that if there are errors on file upload, then the
> record is never deleted from the database. The file upload is resubmitting
> to the same page, and no redirection takes place. WHat's going on?
>
> Carl
>
>