0
Good person, I want to concatenate a string, put it at the end of the directory, which will be my path where saved the images, each user has its folder on the server. I’m not able to concatenate due to the bars that in the explorer is the opposite,!
<?php
$nomepasta = "morto";
$base = $_REQUEST['image'];
$filename = $_REQUEST['filename'];
$binary = base64_decode($base);
header('Content-Type: bitmap; charset=utf-8');
$file = fopen(('UploadFotos/'.$nomepasta).$filename, 'wb');
$teste = 'UploadFotos\'.$nomepasta;
fwrite($file, $binary);
fclose($file);
echo $teste;
According to the php the information
$_FILE
was removed from$_REQUEST
since the version4.3.0
, if you are using a higher version, switch to$_FILE
. As for the bar, try"/UploadFotos/{$nomepasta}"
or//'
in place of/'
.– William Novak
The problem is that the image is saving outside the desired folder, you are saving in the root /Uploadphotos/, when you should save inside a folder Uploadphotos/[email protected]. That’s why I think it’s a question of Apas, because I did the test by putting the direct email in the code and it worked!
– Juliano Morche