Hi All,
I want to write a PHP webpage which allows people to upload images (no
matter what formats) to me and at the same time converts any non-jpeg
image to JPEG.
Here's what I have:
$FileDest = "/uploads/1.gif";
if (!move_uploaded _file($_FILES["file"]["tmp_name"], $FileDest)):
$Error = "Yes";
endif; // This will upload an image to /uploads/1.gif
$V2_MagickComma nd = "mogrify -format JPEG ".$FileDest ;
exec($V2_Magick Command); // I tried to use this to convert the image's
format (gif) to JPEG but this doesn't work.
$FileDest2 = "/uploads/1.jpeg";
$V2_MagickComma nd2 = "convert ".$FileDest ." ".$FileDest 2;
exec($V2_Magick Command2); // I also tried to use this to convert the
image's format (gif) to JPEG but this doesn't work, either.
What seems to be wrong? How do I modify my codes to make my uploading
webpage to work?
Any idea is appreciated!
I want to write a PHP webpage which allows people to upload images (no
matter what formats) to me and at the same time converts any non-jpeg
image to JPEG.
Here's what I have:
$FileDest = "/uploads/1.gif";
if (!move_uploaded _file($_FILES["file"]["tmp_name"], $FileDest)):
$Error = "Yes";
endif; // This will upload an image to /uploads/1.gif
$V2_MagickComma nd = "mogrify -format JPEG ".$FileDest ;
exec($V2_Magick Command); // I tried to use this to convert the image's
format (gif) to JPEG but this doesn't work.
$FileDest2 = "/uploads/1.jpeg";
$V2_MagickComma nd2 = "convert ".$FileDest ." ".$FileDest 2;
exec($V2_Magick Command2); // I also tried to use this to convert the
image's format (gif) to JPEG but this doesn't work, either.
What seems to be wrong? How do I modify my codes to make my uploading
webpage to work?
Any idea is appreciated!
Comment