0

Looking for example codes on how to send images from Raspberry pi to a web server via wifi. i am really new to raspberry pi and there's already a tomcat server. I really need your help

closed as off-topic by goldilocks Jul 4 at 13:49

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be specific to the Raspberry Pi within the scope defined in the help center." – goldilocks
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Welcome. Uploading to a webserver takes place via HTTP, generally but not necessarily via an html interface. Traditionally this is via a multipart upload form but there are other means as well. However, this is platform agnostic -- it doesn't matter whether the upload comes from a raspberry pi or your laptop, etc., it takes place exactly the same way (if you upload something via a web page, it does not matter what computer you are on, it is pretty much the same). You are better off pursuing web programming questions on our larger parent site, Stack Overflow. – goldilocks Jul 4 at 13:49
  • This is a networking related question – Sohan Arafat Oct 28 at 4:58
2

I am sure that both hosts have SSH installed so another solution could be to use SCP/SFTP. If not, try to use a regular FTP client.

For example on your RaspberryPi:

scp /path/to/your/imag.jpg YourUser@Webserver:/path/to/destination/

Make sure that YourUser has permissions to write in your destination directory. If you want to upload a directory don't forget to pass the -r option.

More information about using scp can be found here:

1

That one is really easy.

You should read some tutorials about UNIX.

Use the wget command to upload or download stuff with web servers.

The basic syntax of this command is

wget http://website.com/files/file.zip

This would download the file into your working directory (meaning you'd have to do this from webserver to raspberry)

Here is a basic tutorial for wget:

Using WGET

Another strong program is curl

It would look like

curl -O -C - file:///path/to/some/file

curl man page

This is really a trivial feature of every linux system nowadays, and I guess with the 2 links I posted you should be able to fiddle something together. (If not try watching a youtube video to these programs)

I hope you can manage it

saraba

  • aren't these solutions to DOWNload from a webserver instead of UPload? – ON5MF Jurgen Jul 4 at 13:23
  • @ON5MFJurgen I'm sure I used this for both ways already. Also, since a webserver normally is just another linux server, there should be no big deal on which device pulls from the other. (unless you have webhosting - where you only have a folder for you page) ; also I just wanted to provide OP with a basic idea on which programs there are, since he didn't show any efforts to code / learn something on his own – clockw0rk Jul 4 at 13:25
  • 1
    "since a webserver normally is just another linux server" -> That depends upon the context of use. In this context, I would say it is most likely a piece of software such apache or nginx. But it is a very vague question. – goldilocks Jul 4 at 13:42
  • 1
    @clockw0rk, "wget" is not easy for newbies. I remember a couple of years ago, the first time I learned to use "wget", it took me 3 hours to complete the job of wget, and untar something. Of course I can now do it in minutes. But at that time I was very discouraged and I did give up and stopped playing Rpi for one or two years, until Rpi2 came along, with GUI Desktop, though still slow. At that time I only Windows 7, and I knew how to google, but did not know how to search linux tools, and I did not know stack overflow or rpi stack exchange, ... :( – tlfong01 Jul 4 at 13:47
  • @tlfong01 Yes, I remember struggeling with it too, until the point I needed it at work and was forced to use it. Today I still would recommend everybody to go through the struggle and just try it until you get it, cause it is really mighty. "It seems difficult at first, but everything's difficult at first" [M. Miamoto, around 1600] – clockw0rk Jul 4 at 13:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.