Git Product home page Git Product logo

Comments (12)

ilanni2460 avatar ilanni2460 commented on July 24, 2024 1

@rejetto Haha, it doesn't matter. I don't upload files through authentication now. I can achieve my purpose by just specifying the access rights to the directory. Thank you very much for your timely answer.

from hfs.

rejetto avatar rejetto commented on July 24, 2024

yes, it does.
Refer to https://hfs-3.apidog.io/

from hfs.

rejetto avatar rejetto commented on July 24, 2024

for authentication you can use standard http authentication, possibly with https to avoid clear-text passwords

from hfs.

ilanni2460 avatar ilanni2460 commented on July 24, 2024

@rejetto Thank you very much for your reply. I used the following method to upload files, but still got an error.

curl -X POST --header 'x-hfs-anti-csrf: 1' -u "admin:P@qqq" -H "Content-Type: application/octet-stream" --data-binary "@/root/a.txt" http://127.0.0.1/soft/
Use this method to report an error,this log:
Bad Request

from hfs.

rejetto avatar rejetto commented on July 24, 2024

thanks for reporting!
i will now update the documentation to specify that POST requires multipart, while PUT doesn't.
Refer to this to know correct usage with curl
https://github.com/rejetto/hfs/wiki/Upload#from-command-line

from hfs.

ilanni2460 avatar ilanni2460 commented on July 24, 2024

@rejetto OK, all right. By the way, I would like to ask again, how to overwrite existing files when uploading through API

from hfs.

rejetto avatar rejetto commented on July 24, 2024

do you want all uploads to always overwrite?

from hfs.

ilanni2460 avatar ilanni2460 commented on July 24, 2024

@rejetto I will cover it often。always overwrite。

from hfs.

rejetto avatar rejetto commented on July 24, 2024

then you may want to just change this option
image

otherwise, you can see that i just updated API documentation to include overwrite

from hfs.

ilanni2460 avatar ilanni2460 commented on July 24, 2024

@rejetto Thank you very much, that's definitely covered.

from hfs.

ilanni2460 avatar ilanni2460 commented on July 24, 2024

@rejetto

This is my command to upload files. Because the authentication method is not enabled, I achieve the purpose by setting the access permissions of the directory. Everyone can upload it, and only designated people can view/modify and delete it.

curl -F [email protected] http://192.168.70.193/soft/software_list/

1

from hfs.

rejetto avatar rejetto commented on July 24, 2024

you don't need authentication, or you can't make it work?

from hfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.