Skip to content

Instantly share code, notes, and snippets.

@fbaiodias
Last active March 2, 2016 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fbaiodias/174f3af4ad7e341f2f56 to your computer and use it in GitHub Desktop.
Save fbaiodias/174f3af4ad7e341f2f56 to your computer and use it in GitHub Desktop.
ipfs add captures

Folder structure

somefolder
  subfolder
    deepfile
  config
  otherfile
  link -> points to somefolder/subfolder/deepfile
  folderlink -> points to somefolder/subfolder
  outsidefolderlink -> points to outsidefolder
outsidefolder
  outsidefile

Observations:

POST /api/v0/add?encoding=json&progress=true&r=true&stream-channels=true HTTP/1.1
Host: 127.0.0.1:5001
User-Agent: /go-ipfs/0.4.0-dev/
Connection: close
Transfer-Encoding: chunked
Content-Type: multipart/form-data; boundary=0b66c9ae74787fcd6c678b108812f6f85ed6964eaa4b1d3c717ad1f9384a
Accept-Encoding: gzip
1
-
9a
-0b66c9ae74787fcd6c678b108812f6f85ed6964eaa4b1d3c717ad1f9384a
Content-Disposition: file; filename="somefolder"
Content-Type: application/x-directory
a7
--0b66c9ae74787fcd6c678b108812f6f85ed6964eaa4b1d3c717ad1f9384a
Content-Disposition: file; filename="somefolder%2Fconfig"
Content-Type: application/octet-stream
2b
{
"API": {
"HTTPHeaders": null
}
}
a6
--0b66c9ae74787fcd6c678b108812f6f85ed6964eaa4b1d3c717ad1f9384a
Content-Disposition: file; filename="somefolder%2Ffolderlink"
Content-Type: application/symlink
9
subfolder
a0
--0b66c9ae74787fcd6c678b108812f6f85ed6964eaa4b1d3c717ad1f9384a
Content-Disposition: file; filename="somefolder%2Flink"
Content-Type: application/symlink
12
subfolder/deepfile
aa
--0b66c9ae74787fcd6c678b108812f6f85ed6964eaa4b1d3c717ad1f9384a
Content-Disposition: file; filename="somefolder%2Fotherfile"
Content-Type: application/octet-stream
12
OTHERFILE CONTENT
ad
--0b66c9ae74787fcd6c678b108812f6f85ed6964eaa4b1d3c717ad1f9384a
Content-Type: application/symlink
Content-Disposition: file; filename="somefolder%2Foutsidefolderlink"
43
/Users/xicombd/Code/ipfs/ipfs-multipart/test/fixtures/outsidefolder
a9
--0b66c9ae74787fcd6c678b108812f6f85ed6964eaa4b1d3c717ad1f9384a
Content-Disposition: file; filename="somefolder%2Fsubfolder"
Content-Type: application/x-directory
b5
--0b66c9ae74787fcd6c678b108812f6f85ed6964eaa4b1d3c717ad1f9384a
Content-Disposition: file; filename="somefolder%2Fsubfolder%2Fdeepfile"
Content-Type: application/octet-stream
11
DEEPFILE CONTENT
44
--0b66c9ae74787fcd6c678b108812f6f85ed6964eaa4b1d3c717ad1f9384a--
0
POST /api/v0/add?recursive=true&stream-channels=true HTTP/1.1
User-Agent: /node-ipfs-api/2.13.2/
Content-Type: multipart/form-data; boundary=0h7cgeac1f0qkt9
Host: 127.0.0.1:6001
Connection: close
Transfer-Encoding: chunked
13
--0h7cgeac1f0qkt9
63
Content-Disposition: file; filename="somefolder/config"
Content-Type: application/octet-stream
2b
{
"API": {
"HTTPHeaders": null
}
}
15
--0h7cgeac1f0qkt9
66
Content-Disposition: file; filename="somefolder/folderlink"
Content-Type: application/x-directory
15
--0h7cgeac1f0qkt9
81
Content-Disposition: file; filename="somefolder/folderlink/deepfile"
Content-Type: application/octet-stream
DEEPFILE CONTENT
15
--0h7cgeac1f0qkt9
72
Content-Disposition: file; filename="somefolder/link"
Content-Type: application/octet-stream
DEEPFILE CONTENT
15
--0h7cgeac1f0qkt9
78
Content-Disposition: file; filename="somefolder/otherfile"
Content-Type: application/octet-stream
OTHERFILE CONTENT
15
--0h7cgeac1f0qkt9
6d
Content-Disposition: file; filename="somefolder/outsidefolderlink"
Content-Type: application/x-directory
15
--0h7cgeac1f0qkt9
8d
Content-Disposition: file; filename="somefolder/outsidefolderlink/ousidefile"
Content-Type: application/octet-stream
OUTSIDEFILE CONTENT
15
--0h7cgeac1f0qkt9
65
Content-Disposition: file; filename="somefolder/subfolder"
Content-Type: application/x-directory
15
--0h7cgeac1f0qkt9
80
Content-Disposition: file; filename="somefolder/subfolder/deepfile"
Content-Type: application/octet-stream
DEEPFILE CONTENT
15
--0h7cgeac1f0qkt9--
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment