Pages: [1]   Go Down
Author Topic: Altering files on Arduino+Ethernet web server  (Read 1458 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 2
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quite a while ago I built myself a nifty little Arduino ethernet web server [Link] and one of it's downsides was that in order to update the web server's content, hosted on it's SD card, one had to remove the card, update desired files, and manually restart the server.

So I was wondering if it was at all possible to modify the files on the SD card of an active Arduino web server remotely via a hidden web page.
Any info would be appreciated.


Logged

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1123
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I actually subscribed to this topic because I thought you'd get a few really enlightening responses that would be helpful to my own projects.  Since there's nothing but silence, thought I'd kick off the conversation.

In a full-scale webserver you'd have the ability to run a server-side script to deal with file content uploaded, and clearly our equivalent of that on the Arduino webserver is the sketch itself.  I don't see anything stopping you from writing something in your sketch that deals with data sent to you in a web form, directly to a file with name and location set from other parameters within the form.  I don't know what practical limitations there would be to the data being transferred in this method, however it would I'm certain be very slow.

This is a very cool idea.  Hope the thread doesn't die here without some good ideas being thrown about.

Cheers ! Geoff
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Global Moderator
Melbourne, Australia
Online Online
Brattain Member
*****
Karma: 511
Posts: 19314
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I didn't comment because I thought, yes you could write something that would save files on the SD card. And the files could be the contents of the page you serve up. Bearing in mind the limitations of the RAM, if you did it a byte or so at a time, anything's possible. Doing the hidden web page could be achieved too, you would need to know your HTML, but with, say, cookies, you could send something to the device to identify yourself (or maybe just a fixed IP address).
Logged

http://www.gammon.com.au/electronics

Please post technical questions on the forum - not to me by personal message. Thanks a lot.

Offline Offline
Jr. Member
**
Karma: 2
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I suppose this would be an interesting challenge to tackle.
I have this concept idea where you have a page with a few text and button inputs where a user types out the new file name with it's contents.
I've attached a basic example pic below.

It does seem quite simple though, similar to data logging to SD cards although different in that the user writes the variables for the file name and its contents through an Arduino-hoseted web page.


* Screenshot4.png (64.45 KB, 611x655 - viewed 37 times.)
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quick update,

I just finished toying with some HTML GET/ commands (Commonly used in Arduino web servers to send text to an lcd through a web interface.) and I quickly realized how difficult this would be.
I'm sure there is another way to do all this, but currently, I am at a stand still.

I'm still open to Ideas though.
Logged

Miramar Beach, Florida
Online Online
Faraday Member
**
Karma: 152
Posts: 6178
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

FTP is an alternative, but the code is rather large. Don't know if it will work in an Uno, but does great in a Mega.
http://arduino.cc/forum/index.php/topic,93502.msg707104.html#msg707104
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12630
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quick update,

I just finished toying with some HTML GET/ commands (Commonly used in Arduino web servers to send text to an lcd through a web interface.) and I quickly realized how difficult this would be.
I'm sure there is another way to do all this, but currently, I am at a stand still.

I'm still open to Ideas though.

If you want to do it over the HTTP interface, you'd conventionally use an HTTP Post request with the data you're submitting containing the new page content and associated parameters. If your Arduino is connected to a PC too, you have the option of sending the page update request over the serial link, for example as a sequence of S records.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Pages: [1]   Go Up
Jump to: