Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Applying mtime with HTTP API /api/v0/files/write doesn't seem to work #3225

Closed
mrh42 opened this issue Aug 13, 2020 · 1 comment
Closed

Applying mtime with HTTP API /api/v0/files/write doesn't seem to work #3225

mrh42 opened this issue Aug 13, 2020 · 1 comment
Labels
need/triage Needs initial labeling and prioritization

Comments

@mrh42
Copy link

mrh42 commented Aug 13, 2020

  • Version: interface-ipfs-core version: ^0.139.0
    ipfs-http-client version: ^46.0.0
    Repo version: 8
    System version: x64/linux
    Node.js version: v12.18.3
    Commit: e7396bc
  • Platform: Linux i 5.4.0-42-generic bootstrap #46~18.04.1-Ubuntu SMP Fri Jul 10 07:21:24 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem:

Severity: low

Description:

Using curl I can apply an mtime to a MFS file with /api/v0/files/touch but not with /api/v0/files/write.

Steps to reproduce the error:

% curl -X POST "http://172.30.16.17:5002/api/v0/files/touch?arg=/users/mrh-i/t.txt&mtime=1697263111"

% curl -X POST -F [email protected] "http://172.30.16.17:5002/api/v0/files/write?arg=/users/mrh-i/x.txt&mtime=1697263111&create=true"

% jsipfs files ls -l /users/mrh-i/
-rw-r--r-- Oct 13, 2023, 10:58:31 PM PDT t.txt QmY1qYmfmwjf9CeB3tMNYcuJaVcHZ7oFXiSDqqPmPQfRrF 0
-rw-r--r-- - x.txt Qme8gXcjgesRXRiLcmdDUmupfaaa1yKHYfBbNS6NU7EVGc 945

@mrh42 mrh42 added the need/triage Needs initial labeling and prioritization label Aug 13, 2020
@achingbrain
Copy link
Member

ipfs.files.write takes args as a multipart request, including specifying the mtime as a header in the multipart part.

See how the http client does it for an example: https://github.com./ipfs/js-ipfs/blob/master/packages/ipfs-http-client/src/files/write.js

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

2 participants