Author Topic: Software update  (Read 6331 times)

Offline robo

  • Newbie
  • *
  • Posts: 40
    • View Profile
Software update
« on: February 03, 2009, 03:49:32 PM »
Hi,

Is there possibility to change location file with new software for update? (now when I want to update software I must load z.bin file to uFile system, and if I want to change it for example to a.bin)
How to do this?

Regards,
robo

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: Software update
« Reply #1 on: February 03, 2009, 06:51:04 PM »
Hi Robo

Assuming you are posting via Web Browser, you can control this in the HTML code as follows:

<form action=zS.bin enctype="multipart/form-data" method="post">

This is a uTasker speciality to control the location of the uploaded file and to control an application handler on completion.

If you change zS.bin to aS.bin it will cause the received file to be saved as a.bin rather than z.bin. The S is used to identify the post type. For example, if you have post support for various types of upload, the handler [fnHandleWeb()] will be called with the event INFORM_POST_FAILED or INFORM_POST_SUCCESS with http_session->cDisplayFile set to 'S'. If can thus identify which upload has just terminated and respond accordingly. It may want to serve a special web page on upload success or, as in the case of firmware upload in the demo, cause a restart of the board. In this case 'S' was chosen to signify Software upload.

When copying via FTP a file named a.bin will be placed at the expected location a.bin. Or also a "put z.bin a.bin" will also cause z.bin to be placed at the same location. There is no handler when using FTP since FTP is stand-alone. The application doesn't know that the file has been loaded and so can't automatically reset the board - therefore the HTTP post method is the best one to use generally.

Regards

Mark