I'm making a Python Webhook to intercept FormStack data (sent in JSON format) which includes a file attachment url. I need to download the file attachment and the send it as a mail attachment through SendGrid API.
The SendGrid API requires filename and path as arguments to attach the file.
message.add_attachment('stuff.txt', './stuff.txt')
I referred to urllib2
but I can't seem to find out a way to download file with any extension and get its location for uploading it further.