I might also point out that the samples themselves will not compile with this processor. And there are inconsistsent samples in the folders
DC\samples cpip\http\httpupld2.c vs the samples in DC\samples\remoteprogramupdate
SO I’ve tried to adapt to my code as detailed below.
By renaming the “ZHTML” sample page (because it doesn’t fit the 8.3 naming limitations!) I have an FAT-based page that presents a browse option with an upload button (URL is http://192.168.2.50/fw/upload.zht and I have coded “.zht” appropriately, same as I’ve been using for years in early DC versions).
This file contains the following:
HTTP Upload Form
Current Firmware:
Last Firmware Uploaded:
Image corrupted or not compatible with this hardware.
Upload New Firmware:
In my code I have included the following:
SSPEC_MIMETABLE_START
SSPEC_MIME_FUNC(“.zht”,“text/html”,zhtml_handler),
SSPEC_MIME(“.htm”, “text/html”),
SSPEC_MIME(“.gif”, “image/gif”),
SSPEC_MIME(“.jpg”, “image/jpeg”),
SSPEC_MIME(“.cgi”, “”)
SSPEC_MIMETABLE_END
I also have this:
SSPEC_RESOURCETABLE_START
SSPEC_RESOURCE_P_CGI(“upload.cgi”, firmware_upload,
FWREALM, FW_GROUP, 0x0000, SERVER_HTTP, SERVER_AUTH_DIGEST)
SSPEC_RESOURCETABLE_END
When I select a bin file (which is the same file that is running the code) and click upload, the browser URL goes to
“http://192.168.2.50/fw/upload.cgi” with a
404 Not Found message.
In my code I have included the following lines from the samples:
#use “board_update.lib”
// function prototype for cgi function to handle file upload
int firmware_upload(HttpState * s);
void install_firmware(void);
void update_webvars(void);
struct {
char running[40];
char temp[40];
int show_temp;
int show_install;
char error[80];
int install;
} firmware;
#web firmware
#web firmware.install
#web_update firmware.install install_firmware
and the referenced functions firmware_upload, install_firmware and update_webvars have been copied in from a sample.
I have searched the DC install folder for upload.cgi: there is no such file.
I understand most of what is happening except what “cgi” is and how to use in in DC.
I’m using DC10.72, by the way.
This is a non-trivial question, as you can see by now