Closed FX-HAO closed 8 years ago
Same issue, but with a csv file. Did you figured out what's going on?
@ccquiel Sorry, I don't figure it out even now :( Did you try directly upload the file with Javascript? I just uploaded it successfully by Postman. And please let me know if you work it out.
@FX-HAO Thanks for replying! How did you upload it with Postman? Did you send the whole file as in your first post? I'm trying the following with the requests library:
import requests
url = "https://graph.facebook.com/v2.5/<product_feed_id>/uploads"
params = {
"access_token": my_access_token,
"file": file
}
r = requests.post(url, params=params)
After opening the file (f = open("feed.xml", 'rb')
), I've sent:
file = 'feed.xml'
file = f.read()
file = base64.b64encode(f.read())
file = base64.b64encode(f.read()).decode("utf8")
and none of them work, I keep getting:
Exception: (#100) Invalid file. Expected file of one of the following types: text/csv, text/plain...
:(
getting the same error here. Any update?
Can you try using the new productfeed.py object to upload. You can do so by using the create_upload method.
for me this worked:
curl -X POST \
https://graph.facebook.com/v2.7/
I've seen this post Product Feed Uploads.And i want to know whether this is possbile with facebook-python-ads-sdk?
I've tried the following codes:
But i got the following error: