uIP webserver uplaod/download files

skpgebo wrote on Wednesday, October 13, 2010:

I have an uIP webserver on an ARM7X evaluation board. The webserver works fine, but I would like to implement the possibility to download and upload files with the webserver. Has anyone any suggestion on how that could be implemented ?
using <FORM method=“post” > ?

davedoors wrote on Wednesday, October 13, 2010:

Do you mean upload and download files to a file system, or upload and download files to be programmed into the microcontroller flash memory? If you are using a file system, then which one are you using (just my curiosity, it does not make a difference to the answer).

The normal way would be to use a TFTP implementation, not a web server. TFTP is designed for transferring files to a file system, an HTTP server is not.

skpgebo wrote on Wednesday, October 13, 2010:

I’m running the webserver with Explorer on a windows XP machine, but the webserver could be accessed from any browser on any OS.  The files should be transferred from a file system to the webserver and also from the webserver to a file system.
The files I have in mind is a configuration file which will be an ASCII file to decoded and transferred into an SPI EEPROM on the same hardware as the webserver. The other file would be an bin-file with new firmware, typically transerred to an SPI FLASH on the same hardware as the webserver.

If possible, it could be nice to be able to to this from within the webserver.

rtel wrote on Wednesday, October 13, 2010:

> I’m running the webserver with Explorer on a windows XP machine, but the webserver
> could be accessed from any browser on any OS.  The files should be transferred
> from a file system to the webserver and also from the webserver to a file
> system.

I think the question was about a file system on the device running uIP, not the host.  I think it is ok to assume your host has a file system, but what are you doing with the files on the target side. 

Transferring a file to a webserver is very unclear, a webserver is not in itself a store of files, but something that serves files.

> The files I have in mind is a configuration file which will be an ASCII file
> to decoded and transferred into an SPI EEPROM on the same hardware as the webserver.

So you are actually sending the file, via TCP/IP, to an SPI EEPROM, not to the webserver at all, but you want to use HTTP as means of transferring the file?

Generally webservers are good and passing files from target to host, but not the other way.  An FTP or TFTP server would be used for file transfer.  If you are just changing configuration parameters then you could configure a page that has fields that can be filled in and ‘posted’ to the target.  That way you can change individual parameters without having to transfer a file at all.

> The other file would be an bin-file with new firmware, typically transerred
> to an SPI FLASH on the same hardware as the webserver.

A serial protocol (USB, UART, etc.) can be used to transfer files, or a file transfer protocol, I don’t think you will have much luck with a webserver.

Regards.

skpgebo wrote on Wednesday, October 13, 2010:

May be I am going in wrong direction, but I like to send a file via TCP/IP to an SPI EEPROM/FLASH controlled by the webserver.

I’am already able to configure my hardware via the webserver and updating a SPI EEPROM, but I like to “save”  (and restore) this configuration to an external file as well. All this configuration is done by using HTTP so I like to implement the file upload/download in the HTML-code as well.

The idea of using the webserver for upload/download of files was because our unit only have one ethernet connection, no USB or any UARTs available.