question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to add file to IPFS using add method

See original GitHub issue

I’m using IPFS version 0.4.2 and have cloned branch 0.4.2 . Using this code :

package org.ipfs.api;
import java.io.*;

public class Main {
public static void main(String args[]) throws Exception{

    IPFS m = new IPFS("myhost" , 8080);
    NamedStreamable.ByteArrayWrapper file = new     NamedStreamable.ByteArrayWrapper("hello.txt", "G'day world! IPFS rocks!".getBytes());

try {
        System.out.println(m.add(file));
       } catch (IOException e) {

       e.printStackTrace();  
        }
}
}


```produces error : 

java.io.IOException: Server returned status: 404 with body:  and Trailer header: null
    at org.ipfs.api.Multipart.finish(Multipart.java:106)
    at org.ipfs.api.IPFS.add(IPFS.java:64)
    at org.ipfs.api.IPFS.add(IPFS.java:52)
    at org.ipfs.api.Main.main(Main.java:16)



This should work as is ? Or am I missing something ?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
ianopolouscommented, Sep 2, 2016

@adrian-git-hub-user I’ve pushed a new release which is compatible with ipfs 0.4.3-rc3

0reactions
Kubuxucommented, Sep 2, 2016

@adrian-git-hub-user: there is release that is compatible with the lib https://dist.ipfs.io/go-ipfs/v0.4.3-rc3

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to add file to IPFS using add method · Issue #14 - GitHub
I'm using IPFS version 0.4.2 and have cloned branch 0.4.2 . Using this code : package org.ipfs.api; import java.io.
Read more >
IPFS issue: can't upload files with ipfs.add(file) - Stack Overflow
guys. Few month ago I add ipfs for upload files, all worked correctly, but a week ago I have problem and can't resolve...
Read more >
Unable to upload images to IPFS using ipfs-http-client
I found a solution to my problem! With ipfs-http-client , you need to use ipfs.add as part of an async/await function in order...
Read more >
Lesson: Add Content to IPFS and Retrieve It
Add a file's content to IPFS; Read content out of IPFS using its hash ... One easy way to do this on the...
Read more >
Ipfs.add() not working - Bugs - Infura Community
I am using the javascript ipfs-http-client library recent version. mike (Mike Godsey) May 21, 2020 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found