Jump to content

Getting absolute filepath from image resource


arbitrageur

Recommended Posts

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 by arbitrageur
Link to comment
Share on other sites

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);
			}
		}
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.