Regarding File Downloading

In my SwiftUI App i have managed to upload file to IPFS but as per the changes of method from GET to POST it broke everything. I am not able able to download image. In postman it returns image but in my code it returns some data but the image is always nil. Is there a workaround for these? or any other viable solution? I am using IPFSKit Library

link for the library:- https://github.com/0xZala/IPFSKit

My code for downloading:

    guard let hash = try? fromB58String(urlString.replacingOccurrences(of: "https://ipfs.infura.io:5001/api/v0/cat?arg=", with: "")) else {
        print("no hash")
        return
    }
    IPFSClientManager.shared.fetchJSONFromIPFS(hash: hash) { data in
        
        guard let loadedImage = UIImage(data: data) else {
            return
        }
        
        self.imageCache.set(forKey: self.urlString!, image: loadedImage)
        
        DispatchQueue.main.async {
            self.image = loadedImage
        }
    }
1 Like

please help me if anyone have any idea

1 Like

Please refer to the explicit list of changes that have been implemented:

If it works in Postman (evidence of Infura API is working properly) it could be the case that changes needed to be made on the third-party library (IPFSKit) level, as they might still support GET and have not accounted for POST endpoints.

1 Like

@Jyorge_Maccaline, please let me know if that solves your issue as well!

1 Like