PHP Uploading & Converting Help Needed.
Posted: 2007-06-13T13:24:49-07:00
Hi guys, I am working on a website and I need a small amount of help, I have an upload script I have been slightly working on (not own on scripting) and the website I am working on calls for a image file conversion of .tga to .png
here is my code
I need to get this code below to convert
Any suggestions to doing this? it would be very helpful. I know the code to convert would be something similar to this
Thanks In Advance
- Techku
here is my code
Code: Select all
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"
}
Code: Select all
$foto_upload->replace = (isset($_POST['replace'])) ? $_POST['replace'] : "n"; // because only a checked checkboxes is true
Code: Select all
$foto_upload->convert = (isset($_POST['convert'])) exec('convert file.tga file.png');
- Techku