0

I am successfully executing from the Windows CMD console the following instruction:

curl --user on:on --form "imgupload_front=@C:\Users\franc\Downloads\miau.jpg" --form code=8411916819976 --form imagefield=front --form user_id=id --form password=pass https://fr.openfoodfacts.org/cgi/product_image_upload.pl

I have added internet, internal and external storage permissions. Also: android:usesCleartextTraffic="true"

When I run it in android studio I change the image path to: Internal memory\DCIM\Screenshots\a.jpg

Is there a possibility to execute this instruction with java from android?

Chiscu
  • 25
  • 6
  • Why is this tagged with PHP? – Misunderstood Nov 26 '22 at 02:58
  • 1
    You are trying to upload a file that is on your windows pc. But you Android app on your Android device has no access to files on your pc. Or on mines. – blackapps Nov 26 '22 at 03:40
  • Please search before asking, else the question may be closed. As already suggested, path `C:\Users\franc\Downloads\miau.jpg` is just wrong. – Martin Zeitler Nov 26 '22 at 05:19
  • Regarding putting it as a duplicate, I consider that it is not so. In the questions you show, there is no sending a file to a certain key. Just an upload of a file but not to a certain key. And here is the error. – Chiscu Nov 26 '22 at 19:05
  • On the other hand, good observation, I have already corrected the route, but it keeps giving me an error in android. In the Windows CMD console it works perfectly. – Chiscu Nov 26 '22 at 19:07

0 Answers0