arbitrageur Posted November 3, 2014 Share Posted November 3, 2014 (edited) How does one get the absolute filepath of this: $_FILES["myfile"]["name"] On a web-server? Currently I'm feeding my image as a resource into imagejpg. http://php.net/manual/en/function.imagejpeg.php However, I need to get the file-path so I can send them to an S3 bucket. Thanks for any help! Edited November 3, 2014 by arbitrageur Quote Link to comment https://forums.phpfreaks.com/topic/292237-getting-absolute-filepath-from-image-resource/ Share on other sites More sharing options...
QuickOldCar Posted November 3, 2014 Share Posted November 3, 2014 It's your temp directory. Use this to see where yours is located. echo sys_get_temp_dir(); Quote Link to comment https://forums.phpfreaks.com/topic/292237-getting-absolute-filepath-from-image-resource/#findComment-1495582 Share on other sites More sharing options...
arbitrageur Posted November 3, 2014 Author Share Posted November 3, 2014 Thanks. Can I save to the temp directory so I don't have to deal with deleting temp files? Quote Link to comment https://forums.phpfreaks.com/topic/292237-getting-absolute-filepath-from-image-resource/#findComment-1495584 Share on other sites More sharing options...
arbitrageur Posted November 3, 2014 Author Share Posted November 3, 2014 Any idea how to deal with multiple temp_names? For creation of image thumbnails: if(create_image($fileExt, $_FILES["myfile"]["tmp_name"], $_FILES["myfile"]["tmp_name"], 80) !== FALSE){ // the first function 'create_image' is working, but generate thumbs uses "tmp_name" twice if(generatethumbs($_FILES["myfile"]["tmp_name"], 120, $_FILES["myfile"]["tmp_name"], 85) == TRUE){ $filelocation = $_FILES["myfile"]["tmp_name"]; $aws = new s3; $aws = $aws->putObject($newFileName, $filelocation); image_string($username,$newFileName,$mysqli); } } Quote Link to comment https://forums.phpfreaks.com/topic/292237-getting-absolute-filepath-from-image-resource/#findComment-1495589 Share on other sites More sharing options...
Barand Posted November 3, 2014 Share Posted November 3, 2014 http://php.net/manual/en/features.file-upload.multiple.php Quote Link to comment https://forums.phpfreaks.com/topic/292237-getting-absolute-filepath-from-image-resource/#findComment-1495593 Share on other sites More sharing options...
arbitrageur Posted November 4, 2014 Author Share Posted November 4, 2014 http://php.net/manual/en/features.file-upload.multiple.php I'm dealing with multiple files fine, BUT: I'm making an thumbnail AND remaking the images. I can't save both the thumbnail & remade image to $_FILES["myfile"]["tmp_name"] Atleast not concurrently. Sequentially, yes. Quote Link to comment https://forums.phpfreaks.com/topic/292237-getting-absolute-filepath-from-image-resource/#findComment-1495650 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.