Is there a way to upload custom pictures with API from my PC without uploading them to an image hosting site like imgur first, then giving the link to the API?
Just upload to server
In the call to gfapi.upload_photo
, just specify the file name (in the same directory) as photo_url
.
So instead of gfapi.upload_photo(listing.id, photo_url, 0)
, you would do gfapi.upload_photo(listing.id, photo_filename, 0)
.
This function takes either URL or photo (as you can see in the code).
i tried this before but the image would end up getting squashed
i tried this before but the image would end up getting squashed
If you use a large
image (or not a square dimension), then the image would be squashed. Try a smaller image (e.g. 300kb or something like that).
How do I format the path to the file? IF I do like âC:Users/âŚ/xy.jpgâ; then I get the Error: Invalid URI error. If I just write xy.jpg then I get an error aswell.
put the picture into the same folder as your js files (probably your sample folder) and specify the file name instead of putting a url like this
if you get a error like this , then obviously the image is too big and youâll need to compress it
Im not sure what is the problem, Im doing it like this but I still get the error. The image is in the directory where the script is.
name: âRequestErrorâ,
message: âError: Invalid URI âtest.pngââ,
Still couldnt figure it out
weird. everything looks right to me
Try putting the image file in the same folder
where you launch the script.
It is in the same directory, both the script and the picture is in the gfapi/src/samples folder
I meant same folder where you run the script
. So if you launch the script in node src/samples
from the gfapi
folder, then try putting the photo in the gfapi
folder.
If that doesnât work, try to specify the full path with \\
(two backslash) as specified https://nodejs.org/api/path.html#path_windows_vs_posix
Windows is in its own world with file path backslash.
Hello @Surpressed,
This case may help you: https://gameflip.zendesk.com/hc/en-us/requests/new
Try uploading the image to a hosting site and copying the direct link into the photo_url.
If not, I hope that the others info will work. They should be more helpful at this, Iâm more of a developer than this style.
Hello Everyone
For the next people who might ask the question. I found a solution to host your photos simply and make them accessible for your requests.
You can use AWS (Amazon Web Services) and create an S3 instance. Itâs like a dropbox or google drive but in my case the api was not able to retrieve my images through these hosts.
Itâs free and easy to set up! I share a link below but there are a lot of videos on YouTube.
I hope this will help
Good day to all
I still got problems with this, wiriting here to bump the thread. Has anyone come up with a solution?
Still got the problem
Did you ever find a solution?
every time i upload images directly dont know there is other way too