I'm trying to use Uploadify (http://www.uploadify.com
), pretty nice jQuery script when it comes to upload files on the server with included examples, and a real pain - mostly cause of lack of documentation - when it comes to use it with a record insert or update (with PHP and MySQL)
This is my flow:
I have a form with some fields and an "uploadified" file field
When I complete to upload a file, I should have in return a hidden file field with the full path of the uploaded file
At this point, the file is uploaded and the form is ready to be inserted in the database (I'll store only the path of the file, non the "BLOB" image)
Seems pretty straight, insn't it? Well, it's a real pain
'Til now I can upload a file and get the hidden field, but here I come with a big trouble...
I use a PHP class to upload and manipulate the uploaded file (mostly images), so that files that accidentally have the same name automatically get an incremental number (myPicture.jpg, myPicture_1.jpg, myPicture_2.jpg, etc...); well, Uploadify simply ignore this: if I upload the file "myImage.jpg" and there's yet a "myImage.jpg" on the server, the PHP class renames it in "myImage_1.jpg", while Uploadify still retains "myImage.jpg", so that it's unuseful...
In other words, Uploadify uses the filename that it supposes to be, NOT the real file name as returned by the PHP class
Is there a comprehensive Uploadify + Insert/update + PHP + MySQL tutorial out there?
I attach the files I'm using: please create a database, execute the uploads.sql file, modify connection setting in /Connections/connIWF.php and launch the /uploadify/index.php