•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 423,818 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,801 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 219 | Replies: 0
![]() |
Hi, Dreamhost has demonstrated image magick utilities can work from a web page.
Please glance through my code, and help me find how to get it right.
As it is, available at tefflox.net/clients/superiorminitrucks/admin (if you want to see the errors)
the photos are uploaded just fine, but they are not resized.
tefflox.net/clients/superiorminitrucks/admin/dhtest.php also works. i am trying to get its functionality to work in the ~/upload.php script, accessible from the foremost address.
thank you. I hope to deliver this package to the client by wednesday.
here is the pertinent segment of the code ----
The counter variable, $img, is declared first thing in the php code.
Please glance through my code, and help me find how to get it right.
As it is, available at tefflox.net/clients/superiorminitrucks/admin (if you want to see the errors)
the photos are uploaded just fine, but they are not resized.
tefflox.net/clients/superiorminitrucks/admin/dhtest.php also works. i am trying to get its functionality to work in the ~/upload.php script, accessible from the foremost address.
thank you. I hope to deliver this package to the client by wednesday.
here is the pertinent segment of the code ----
The counter variable, $img, is declared first thing in the php code.
// now we can loop through $files, and feed each element to the class
$location = '/usr/bin/mogrify';
foreach ($files as $file) {
// we instanciate the class for each element of $file
$handle = new Upload($file);
// then we check if the file has been uploaded properly
// in its *temporary* location in the server (often, it is /tmp)
if ($handle->uploaded) {
// now, we start the upload 'process'. That is, to copy the uploaded file
// from its temporary location to the wanted location
// It could be something like $handle->Process('/home/www/my_uploads/');
/**********************
mogrify images
***************************/
if($img == 0) {
$command = "/usr/bin/mogrify -resize 600x450 " . $file[$img];
exec ($command);
$handle->Process("../inventory/trucks/"); }
else if ($img == 1) {
$command = "/usr/bin/mogrify -resize 600x450 " . $file[$img];
exec ($command);
$handle->Process("../inventory/trucks/"); }
else if ($img == 2) {
$command = "/usr/bin/mogrify -resize 600x450 " . $file[$img];
exec ($command);
$handle->Process("../inventory/trucks/"); }
else if ($img == 3) {
$command = "/usr/bin/mogrify -resize 600x450 " . $file[$img];
exec ($command);
$handle->Process("../inventory/trucks/"); }
else if ($img == 4) {
$command = "/usr/bin/mogrify -resize 300x225 " . $file[$img];
exec ($command);
$handle->Process("../inventory/trucks/"); }
else if ($img == 5) {
$command = "/usr/bin/mogrify -resize 100x75 " . $file[$img];
exec ($command);
$handle->Process("../inventory/trucks/"); }
else if ($img == 6) {
$command = "/usr/bin/mogrify -resize 100x75 " . $file[$img];
exec ($command);
$handle->Process("../inventory/trucks/"); }
else if ($img == 7) {
$command = "/usr/bin/mogrify -resize 100x75 " . $file[$img];
exec ($command);
$handle->Process("../inventory/trucks/"); }
// we check if everything went OK
if ($handle->processed) {
// everything was fine !
echo '<fieldset>';
echo ' <legend>file uploaded with success</legend>';
echo ' <img alt="" src="../inventory/trucks/' . $handle->file_dst_name . '" />';
echo '</fieldset>';
} else {
// one error occured
echo '<fieldset>';
echo ' <legend>file not uploaded to the wanted location</legend>';
echo ' Error: ' . $handle->error . '';
echo '</fieldset>';
}
} else {
// if we're here, the upload file failed for some reasons
// i.e. the server didn't receive the file
echo '<fieldset>';
echo ' <legend>file not uploaded on the server</legend>';
echo ' Error: ' . $handle->error . '';
echo '</fieldset>';
}
$img++;
}![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
access activation api blogger blogging blogs code code injection combo dani daniweb data debugging development dreamweaver dropdownlist epilepsy gdata google gpl griefers hackers html innovation javascript key linux microsoft module net news openbsd product programming reuse rss serial source tags vista web wysiwyg xml
- help to debug my code (C++)
- Debug code. Any thoughts? (Java)
- Debug (C++)
- Question on my code in tower of hanoi (Assembly)
- Can anyone check my code!!!! (C)
- debug my prog to sort an array (C++)
- i need a code for first come first serve simulation using visual basic (Visual Basic 4 / 5 / 6)
Other Threads in the PHP Forum
- Previous Thread: php safe_mode = off
- Next Thread: image upload problem


Linear Mode