webent Posted June 24, 2008 Share Posted June 24, 2008 Hi, it's very easy for me to get image data when I am uploading images, I guess the whole "enctype="multipart/form-data"" takes care of that, because I can then retrieve the "name, type, and size" of the image... My problem is, what if the images are already uploaded, how do I break the image up into an array to get it's "name, type, and size" properties? $dirname = "/home/username/public_html/storage/images/"; $pattern = "(\.gif$)|(\.GIF$)|(\.jpg$)|(\.JPG$)|(\.jpeg$)|(\.JPEG$)|(\.png$)|(\.PNG$)|(\.bmp$)|(\.BMP$)"; $files = array(); if (isset($_POST['insert_images'])) { if ($handle = opendir($dirname)) { while(false !== ($files = readdir($handle))) { if(eregi($pattern, $files)) { //insertImages($files); echo '<pre>'; print_r ($files); echo '</pre>'; } } } closedir($handle); } Quote Link to comment https://forums.phpfreaks.com/topic/111754-solved-getting-image-data/ Share on other sites More sharing options...
.josh Posted June 25, 2008 Share Posted June 25, 2008 I don't get it. First you say I guess the whole "enctype="multipart/form-data"" takes care of that, because I can then retrieve the "name, type, and size" of the image... but then you say how do I break the image up into an array to get it's "name, type, and size" properties? so...first you say you got it, then you say you don't...so which is it? Quote Link to comment https://forums.phpfreaks.com/topic/111754-solved-getting-image-data/#findComment-573692 Share on other sites More sharing options...
webent Posted June 25, 2008 Author Share Posted June 25, 2008 When I upload images, I can get their data, I assume because of the "enctype="multipart/form-data""... My problem is that I have a folder full of thousands of images that are already uploaded, and I want to extract their data... they're already uploaded, so I don't get the benefit of "enctype="multipart/form-data"" doing it's job of breaking my file up... Quote Link to comment https://forums.phpfreaks.com/topic/111754-solved-getting-image-data/#findComment-573693 Share on other sites More sharing options...
.josh Posted June 25, 2008 Share Posted June 25, 2008 ah okay. gd Quote Link to comment https://forums.phpfreaks.com/topic/111754-solved-getting-image-data/#findComment-573694 Share on other sites More sharing options...
webent Posted June 25, 2008 Author Share Posted June 25, 2008 Got it, thank you very much Crayon Violent Quote Link to comment https://forums.phpfreaks.com/topic/111754-solved-getting-image-data/#findComment-573695 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.