Not able to download IPFS object using 'Get' in infura

I am trying to upload a file on ipfs using infura and trying to retrieve it, but not able to do it.
Please help.

Here is my code in Python:

import requests
import json

files = {
‘file’: (’/Sample-jpg-image-5mb.jpg’),

response =‘’, files=files)
p = response.json()

params = (
(‘arg’, p[‘Hash’]),

Hello @SARVESH_DUBEY and welcome to our community site.

Can you share the response output you get back when you post the file? Are you able to confirm that the file gets uploaded at all?

Hello @wuehler , I am facing the problem of downloading the ipfs object which I uploaded.
After writing the request.get command too I am not able to download anything, but the response code is 200

For the code:

import requests
import json
import os
files = {
‘file’: (‘Sample-jpg-image-5mb.jpg’),
response =‘’, files=files)
p = response.json()
print p

Response is:
{u’Hash’: u’QmS1eq4nEXi5VHgrHjD9WzU1jZ6miZLcGgpdcwhmwioVSs’, u’Name’: u’file’, u’Size’: u’32’}

Can you check the method which I have implemented is correctly uploading the file.

I would recommend utilizing a well developed client library to implement your interactions with IPFS. Have you had a chance to look over this client library?

@wuehler Yeah I used ipfshttpclient before using infura. Actually the reason for shifting to infura is to get daemon running of infura than to start my own daemon. And also get free storage of ipfs objects.

You can use the Infura IPFS gateway with the ipfshttpclient library, just point the code at the Infura endpoint rather than your own.

Hi Sarvesh,

I’ve just tested the following based on the example in their docs and it worked fine:

>>> client = ipfshttpclient.connect('/dns/')
>>> res = client.add('mw')
>>> res
{'Name': 'mw', 'Hash': 'QmXixLM5V3LXnEe2tJfHdwe7RBYNYbDrNw8DHYqjczf7R1', 'Size': '11'}

I hope this helps!