28, May 2012

Renaming a thumbnail during creation - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Easy PHP Upload (Moderator: Olaf)
Topic: Renaming a thumbnail during creation
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author 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: Male
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


« Reply #2 on: Jul 05, 2006, 04:04:37 pm »

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'
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Jul 05, 2006, 04:10:52 pm »

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: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #5 on: Jul 06, 2006, 09:06:47 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"

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
Tags : databases Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Easy PHP Upload (Moderator: Olaf)
Topic: Renaming a thumbnail during creation
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 11:51:50 am





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.