I have a wordpress site with a form in it from Gravity Forms. In some of the form fields, users are required to upload a file. I'm using the GF API to retrieve the form entries, specifically the fields where users had to upload files, with python's urllib.urlopener
.
Similar to this post, I try retrieving and writing the file to my local drive, but the problem is I get this as an error:
IOError: ('http error', 403, 'Forbidden', <httplib.HTTPMessage instance at 0x0000000004770C88>)
This only happens with the URLs of the uploaded files from the entries. All other public PDFs work and I'm able to write them to my drive with response.content
.
I've added headers to the urllib.URLopener.addheader
object. But why am I forbidden?