Hi
How can I upload a JPG image and convertit into jpg (lower-case)?
Thanks
Hi
How can I upload a JPG image and convertit into jpg (lower-case)?
Thanks
Last edited by lord22; 11-16-2009 at 05:58 AM.
Upload it like normal, and just change the name when you are saving it to the server. This is very simple, and if you are only doing a certain name then it is just changing "JPG" to "jpg"... that's all.
If you need more help, you will need to post more information.
Please use a more descriptive title than "Help", etc. It will let us know what we are looking at, and make it easier to find the thread if we need to come back to help later.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
lord22 (11-16-2009)
PHP Code:<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data">
<input name="uploaded" type="file" />
<input type="hidden" name="sent" value="submitted" />
<input type="submit" value="Upload File" />
</form>
<?php
if (isset($_POST['sent'])) {
$file_name = basename($_FILES['uploaded']['name']);
$ext = substr($file_name,strlen($file_name)-3,3);
$lowercase_it = explode($ext, $file_name);
$file_name = $lowercase_it[0] . "jpg";
$dir = "images/";
$put_it_up = $dir . $file_name;
if (move_uploaded_file($_FILES['uploaded']['tmp_name'], $put_it_up)) {
echo "Uploaded";
}
else
{
echo "Error ".$_FILES['uploaded']['error'];
}
}
?>
lord22 (11-16-2009)
orPHP Code:$text="sampleimage.JPG";
$text=str_replace("JPG","jpg",$text);
PHP Code:<?php
$text="http://www.animeviews.com/images/armitage.JPG";
$text=explode('.',$text);
$num=count($text);
$num=$num-1;
$text[$num]=strtolower($text[$num]);
$text=implode('.',$text);
echo "$text";
?>
To choose the lesser of two evils is still to choose evil. My personal site
lord22 (11-16-2009)
Hi, sorry for the title, it was a mistake- I changed it.
Thank you very much!
Bookmarks