Facebook Image upload - php

I want to upload the image on the facebook but there is a problem. I am facing the following error.
Fatal error: Uncaught CurlException: 26:
I found the exact problem here
The solution is give and he said to change the path as
# The URL for the Image to Transfer
$imageURL = 'http://server.com/the_image.jpg';
I did not understand what is meant by http://server.com either facebook.com or localhost??

$imageURL means the url of the image you want to upload.
Example you want to upload an image which is hosted at some website. The the url to the image is the $imageURL.
It will be easier to explain if you posted some codes.
I think you should have posted your doubt in the other question itself.

Related

podio api file upload from url

Have tried the API call as listed on Podio dev site to upload a file and I am not getting much joy.
I am trying to "Upload a file" in the first instance using the POST operation and passing the json with the source url to the endpoint as specified.
I can use other methods just fine but since there is little in the way or error feedback I am stuck I keep getting error 404
I have used - https://developers.podio.com/doc/files/upload-file-1004361
(have tried both GET & POST)
image of method with error i get
Upload file method that you are trying to use (https://developers.podio.com/doc/files/upload-file-1004361) is expecting file path which is supposed to be local file but not url.
Here is example of how it should be used:
http://podio.github.io/podio-php/api-requests/
$file = PodioFile::upload($path_to_file, $filename_to_display);
print 'File uploaded. The file id is: '.$file->id;
Here is another example on how to work with files:
https://developers.podio.com/examples/files

mPDF not showing image in generated PDF instead showing red x symbol and full url for background image

Recently I have moved from my staging server to production server and I don't have access to any of these servers.
Both of these servers are linux.
On the new server while generating the pdf using mPDF with symfony 1.4 framework, images like rupee symbol are not getting displayed instead a small red "x" symbol is getting displayed in pdf.
Also, when I try to give background image to pdf, full image path like "http://example.com/image/rupee-image.jpg" is getting displayed instead of image.
Rupee symbol, other images and background images are working fine on my staging server.
When, I did $mpdf->showImageError(), It's saying "mPDF Image Error: Could not find image file" and pasting the url in browser displays the image perfectly.
Any help will be greatly appreciated.
mPDF is telling you that it's not finding the image.
Without seeing your code it's difficult to hint you on what's wrong.
Still you probably what to try referring to your images using a full path locally.
So instead of reference like http://example.com/image/rupee-image.jpg
use something like /var/www/mysite/image/rupee-image.jpg , same as if checking the image is there using the command line.
HTH
I had similar problem, i fixed it with replacing http:// to https://. Watch out for it.
I fixed it myself... I have created a variable in my template and then replaced that variable with image location from my action class, using $mpdf->WriteHTML(str_replace('rupee_symbol','₹',$html1));
My problem was PHP 7 in this case! I check condition
if (!empty('/images/someimg.png')) {
echo '<img ...';
} else {
echo 'error in PHP 7';
}
Be carefull using it. Version PHP 7.0.19

FPDF error: Unexpected end of stream

I have a perfectly working setup of FPFD on my localhost(windows) it generates the pdf files alright. However, when i uploaded to the production environment(Linux), it throws this silly error.
I have been trying to trouble shoot for the past 2hrs now. the error does not give any pointers as to where the stream is suddenly ending. Have posted on their forum but that place looks dead to me.
Please who has used or encountered this error before?
Any help will be greatly appreciated.
After hours and days or researching, I found that a png image I was trying to use was not uploaded successfully....it was partially uploaded....I minified the image and reuploaded, and the error disappeared.
This error occur because of the image is not completely uploaded to the particular folder you are storing . Example-> creating an image but that image is not complete then it will give this error . so in this case first check that image is there or not and then put the static url to the pdf->image('static url which you can see in you web browser',0,0,-72) and the check it or else use any web image url to check it .
And when your have space or dot in you url that you are creating after uploading Example-> https://adc.com/ xyz .png it will also create the same problem .

Unsupported image type with fpdf

i have this message error:
Unsupported image type:imagePath was not found on this server.
I want to create pdf with jpg images taken from the iphone. Unfortunately this does not work. The image path is just seen that I can access it from my browser. When I change the way the path is erroneous.
A exemple of the code
$pdf->Image('../firstParthPath/'.$_SESSION['environment'].'/secondParthPath'.$ImageName,null,$heigth,40,50);
$ImageName are /image404-120404.jpg for exemple. I have tested variable name. It has /image404-120404.jpg
$heigth is a variable that is also handled automatically. It always has the desired content.
I tried to replace null with 0
I tried to add the option 'JPG'. Without success.
a exemple of image
http://imageshack.us/photo/my-images/72/image398120404.jpg/
It could be that PHP is not understanding the location via the relative path starting with '../'. You could try explicitly prepending the script path before it to make sure PHP is looking in the correct place:
(dirname(__FILE__) . '/../firstParthPath/'.$_SESSION['environment'].'/secondParthPath'.$ImageName,null,$heigth,40,50);
It's resolved. It was a verification error in the next picture. Now the problem's are resolved

FPDF Image from Dynamic Source. php/png/pdf. Can't get image to work

http://babymoments.co/preview/highres%20preview/5_357/
According to the FPDF documentation here: http://www.fpdf.org/en/doc/image.htm
You are supposed to be able to use an Image from a dynamic source.. however, as per the first link, i'm getting an fopen error.
Any suggestions?
Code Snippet:
// Overlay Text & Images
$pdf->Image($conf['rbase'].'page_maker/image_hr.php?id=5&side=1&bg=cover_pink&lo=0_1&imgtxt=0|0|u5_1310329746.jpg##1|1|Elina\'s Puppies 9/2/2010|15|arial_bi.ttf|db0ddb|fedfe4&applet_type=cover',$sx,$sh,(0-$dpi), 0, 'png');
You are trying to open a local php file with get parameters - try instead to open the image file as a url. For example :
http://domain.com/image.php?id=5
Or in your case...
http://babymoments.co/preview/page_maker/image_hr.php?id=5&side=1&bg=cover_pink&lo=0_1&imgtxt=0|0|u5_1310329746.jpg##1|1|Elina's%20Puppies%209/2/2010|15|arial_bi.ttf|db0ddb|fedfe4&applet_type=cover
I wouldn't fetch the preview over HTTP but would include the required code and generate the image in the same script that generates the PDF. That way there is no problems with setups that have disabled fopen()-usage with URLs.
I was implementing a barcode for a label printer. So I was using the 'barcodegen' library and 'fpdf' library for this project, but I was having problems including dynamically the image generated with barcodegen, giving me the following error:
FPDF error: Not a PNG file: ./misc/barcodegen/mostrar-codigo-bcgcode39.php
Afeter that, I use one of the answers described here, and I solved the problem using the full URL of the image, like this:
$pdf->Image("http://localhost/caaf/misc/barcodegen/mostrar-codigo-bcgcode39.php",0,0,20,0,'PNG');
And it worked for me.

Categories