Giter VIP home page Giter VIP logo

Comments (15)

lg469 avatar lg469 commented on September 8, 2024

现在就可以啊 /upload 参数file

from telegraph-image.

missedmessage avatar missedmessage commented on September 8, 2024

能否提示一下如何调用呢,我用PHP试了一下,没有返回正确的值。
代码如下:

<?php
    if(isset($_POST['submit'])) {
        $file = $_FILES['file']['tmp_name'];
        $url = 'https://im.gurl.eu.org/upload';

        $cFile = new CURLFile($file);
        $postData = array('file' => $cFile);

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        $response = curl_exec($ch);
        curl_close($ch);

        echo "<pre>" . htmlspecialchars($response) . "</pre>";
    }
  ?>

from telegraph-image.

lg469 avatar lg469 commented on September 8, 2024

image
不懂php,我用接口请求工具是能成功返回结果的

from telegraph-image.

pooneyy avatar pooneyy commented on September 8, 2024

image 不懂php,我用接口请求工具是能成功返回结果的

这是哪个软件?看着比postman好

from telegraph-image.

lg469 avatar lg469 commented on September 8, 2024

image 不懂php,我用接口请求工具是能成功返回结果的

这是哪个软件?看着比postman好

ApiPost

from telegraph-image.

Airmole avatar Airmole commented on September 8, 2024

Apifox直接生成php-curl的代码应该就可以了,很香

from telegraph-image.

2424004764 avatar 2424004764 commented on September 8, 2024

image
可以直接上传

from telegraph-image.

huluohu avatar huluohu commented on September 8, 2024

image 可以直接上传

请问下哈,上传返回的json能否是字典而不是数组,目前看api是单图上传,返回数组似乎也不太符合语义;另一点就是我想跟一些工具,也不大支持数组格式的报文。

from telegraph-image.

2424004764 avatar 2424004764 commented on September 8, 2024

from telegraph-image.

huluohu avatar huluohu commented on September 8, 2024

那得自己改一下接口返回了
直接改reponse不是太合适,我想新增一个,比如叫 /upload/v2,请教下可以在哪个文件里加吗

from telegraph-image.

MicroMatrixOrg avatar MicroMatrixOrg commented on September 8, 2024

大佬,他这个工具的思路是什么啊,由于nuxt那里是打包之后的,我没法看到代码细节
没法复刻

from telegraph-image.

huluohu avatar huluohu commented on September 8, 2024

from telegraph-image.

zhongyuanqi avatar zhongyuanqi commented on September 8, 2024

请问下,file对应的值,是图片转Base64的值吗,为什么传的不行,加了base64的头“data:image/jpeg;base64,”和没加头的值都试了。结果都是"error": "No files passed"。

from telegraph-image.

muyiacc avatar muyiacc commented on September 8, 2024

请问下,file对应的值,是图片转Base64的值吗,为什么传的不行,加了base64的头“data:image/jpeg;base64,”和没加头的值都试了。结果都是"error": "No files passed"。

测试工具如果是 apifox的话,步骤为 点击body再选择form-data,参数名为file,类型选择为file,之后右边的参数值就会出现上传按钮,这是截图
图片

from telegraph-image.

ZAIDU-Miren avatar ZAIDU-Miren commented on September 8, 2024

image 不懂php,我用接口请求工具是能成功返回结果的

但是使用代码axios就是403错误

from telegraph-image.

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.