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!

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);
			}
		}

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.