Topic: Renaming a thumbnail during creation (Read 2870 times)
Bill Cosby is my Father
Posts: 4
28 credits Members referred : 0
« on: Jul 05, 2006, 03:03:49 am »
Hi, I really like the class, but I have a question, I need to be able to rename the thumbnail that gets created while using foto_upload.php, can you help out?
One other question, how can I use the database function in conjunction with the foto-upload?
Thanks,
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #1 on: Jul 05, 2006, 08:14:02 am »
Quote
I need to be able to rename the thumbnail that gets created while using foto_upload.php, can you help out?
You need two names for the fotto and the thumbnail? why not using two directories?
Quote
One other question, how can I use the database function in conjunction with the foto-upload?
check the example "upload_db_example.php", The name you need is inside the variable "file_copy"
Bill Cosby is my Father
Posts: 4
28 credits Members referred : 0
You need two names for the fotto and the thumbnail? why not using two directories?
Because that's what the customer wants. They want the thumbnail suffixed with '_thumb'
OK, in that case you have to write a custom function...
Bill Cosby is my Father
Posts: 4
28 credits Members referred : 0
« Reply #4 on: Jul 06, 2006, 05:25:10 am »
Quote
One other question, how can I use the database function in conjunction with the foto-upload? check the example "upload_db_example.php", The name you need is inside the variable "file_copy" [/QUOTE]
So just do this :
Add connection string and then add the sql statement to the function. Correct?
if (isset($_POST['Submit']) && $_POST['Submit'] == "Upload") { $foto_upload->the_temp_file = $_FILES['upload']['tmp_name']; $foto_upload->the_file = $_FILES['upload']['name']; $foto_upload->http_error = $_FILES['upload']['error']; $foto_upload->replace = (isset($_POST['replace'])) ? $_POST['replace'] : "n"; // because only a checked checkboxes is true $foto_upload->do_filename_check = "n"; if ($foto_upload->upload()) { $foto_upload->process_image(false, true, true, 80); $foto_upload->message[] = "Processed foto: ".$foto_upload->file_copy."!"; // "file_copy is the name of the foto" mysql_query(sprintf("INSERT INTO file_table SET file_name = '%s'", $foto_upload->file_copy)); } }
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
One other question, how can I use the database function in conjunction with the foto-upload? check the example "upload_db_example.php", The name you need is inside the variable "file_copy"
So just do this :
Add connection string and then add the sql statement to the function. Correct?
if (isset($_POST['Submit']) && $_POST['Submit'] == "Upload") { $foto_upload->the_temp_file = $_FILES['upload']['tmp_name']; $foto_upload->the_file = $_FILES['upload']['name']; $foto_upload->http_error = $_FILES['upload']['error']; $foto_upload->replace = (isset($_POST['replace'])) ? $_POST['replace'] : "n"; // because only a checked checkboxes is true $foto_upload->do_filename_check = "n"; if ($foto_upload->upload()) { $foto_upload->process_image(false, true, true, 80); $foto_upload->message[] = "Processed foto: ".$foto_upload->file_copy."!"; // "file_copy is the name of the foto" mysql_query(sprintf("INSERT INTO file_table SET file_name = '%s'", $foto_upload->file_copy)); } }
yes looks fine...
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=3137