【问题标题】:How to upload files to anonfile api android studio如何将文件上传到anonfile api android studio
【发布时间】:2022-01-08 07:00:33
【问题描述】:

我正在尝试制作一个应用程序并能够通过他们的 api 将文件上传到 anonfiles。但是我真的不知道怎么做,因为我从来没有使用过这种类型的api。

请求示例

curl -F "file=@test.txt" https://api.anonfiles.com/upload

我在 webview 中尝试过,它可以工作,但我希望能够在没有 webview 的情况下上传

<form enctype="multipart/form-data" action="https://api.anonfiles.com/v1/upload" method="POST"> 
    <!-- MAX_FILE_SIZE must precede the file input field --> 
    <input type="hidden" name="MAX_FILE_SIZE" value="30000" /> 
    <!-- Name of input element determines name in $_FILES array --> 
    Send this file: <input name="file" type="file" /> 
    <input type="submit" value="Send File" /> 
</form> 

【问题讨论】:

  • 您还在寻找解决方案吗?如果是,我有一个

标签: java android api android-studio file-upload


【解决方案1】:

您需要在 Android 中做一些事情才能大声做到。首先,您需要获得访问互联网的权限,即设备上的存储空间。这是一个关于如何做你想做的事的很棒的教程。

https://www.youtube.com/watch?v=j3hdVJ9aCWs

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-07-30
    • 2012-11-17
    • 2015-06-25
    • 2019-08-01
    • 1970-01-01
    • 2020-11-02
    • 1970-01-01
    相关资源
    最近更新 更多