0

On the basis of the documentation for command.cgi and upload.cgi, I have a simple sync application that first retrieves a list of files and then tries to delete them from the device.

However, the delete operation always fails with a 404 error.

The request being issued is like

GET /upload.cgi?DEL=/DCIM/109___06/IMG_0611.JPG HTTP/1.1
Host: 192.168.0.1
User-Agent: ...

The file given as argument to DEL certainly exists on the device since the value is taken directly from a file list response immediately prior.

The full response from the FlashAir API is:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD>
<BODY><H1>404 Not Found</H1>
The requested URL was not found on this server.
</BODY></HTML>
Jean-Paul Calderone
  • 47,755
  • 6
  • 94
  • 122

1 Answers1

0

Does http://192.168.0.1/upload.cgi certainly exist? Since 404 Not Found is displayed, there is a possibility that you can not access the API URL in the first place.

tell k
  • 605
  • 2
  • 7
  • 18
  • Oh, that's a very good thought. Requests for `/upload.cgi` also fail with a 404! Hmmm. – Jean-Paul Calderone Jun 08 '17 at 14:29
  • With this in mind, re-reading the upload docs, I think that all of upload.cgi must be disabled by default and to use it it has to be enabled by writing UPLOAD=1 to the config. My prior reading of those docs led me to believe only actual uploads required this setting... – Jean-Paul Calderone Jun 08 '17 at 14:34