Auto upload to webpage - FTP?
Author
Discussion

torqueofthedevil

Original Poster:

2,088 posts

209 months

Thursday 14th December 2017
quotequote all
I have some software which controls a camera, the photos can be saved to a folder on the hard drive, or automatically FTP uploaded.
When you click on the FTP settings it asks for a FTP domain or IP address.


What I want to achieve (ive seen other people do this) is for a simple webpage - no formatting, just a blank white page, with the JPGs listed down the side. These are hyperlinks and when you click on them the photo opens.

This is accessible by anyone with the web address, more precisely it is just a host name, with no http://www.

The idea is that once it is set up, it just runs itself, it doesn't require me to manually upload, or authorise anything etc.

To achieve all the above do I just a simple webpage like the Business deal shown here: https://www.123-reg.co.uk/web-hosting/ and I just set the software to FTP upload to that page?

TIA

jonamv8

3,306 posts

198 months

Thursday 14th December 2017
quotequote all
If you upload via ftp then it wont auto show on a webpage unless you have an app running to display all JPEGS in that folder. You’ll need some code on an index.html file to reference the JPEGS

SOUNDS SIMPLE THO

hyphen

26,262 posts

122 months

Friday 15th December 2017
quotequote all
What quality (size) are the images going to be, how many and how popular?

As you may instead want to host them on a image site and link to them rather than host yourself.

anonymous-user

86 months

Friday 15th December 2017
quotequote all
If uploading to a webserver then some webservers can be configured to allow folder browsing so no html is required .... works just like browsing local drives. Have a look to see if that is available. Some providers will probably turn off folder browsing altogether and not allow you to change it but 123reg may be more 'open'.
Mike

torqueofthedevil

Original Poster:

2,088 posts

209 months

Friday 15th December 2017
quotequote all
jonamv8 said:
If you upload via ftp then it wont auto show on a webpage unless you have an app running to display all JPEGS in that folder. You’ll need some code on an index.html file to reference the JPEGS

SOUNDS SIMPLE THO
I think this is closest to what I’m looking for, the page I have seen that runs as I want mine to, has this visible at the top

Index of /

Which looks like a bit of html code which is visible?

Under that it says

Name

And then under that is just a list of the photos (shown as hyperlinks) with the newest on top. How complicated would it be to write this code and how likely to find a website that will accommodate it?

The photohisting site sounds like a cheaper alternative to purchasing a webpage but not sure if that would require input from me rather than being automated. This needs to display multiple photos a day for a year or more. Photos online can be smaller file size - I will save better copies locally.

Cheers

miniman

30,257 posts

294 months

Friday 15th December 2017
quotequote all
torqueofthedevil said:
I think this is closest to what I’m looking for, the page I have seen that runs as I want mine to, has this visible at the top

Index of /

Which looks like a bit of html code which is visible?

Under that it says

Name

And then under that is just a list of the photos (shown as hyperlinks) with the newest on top. How complicated would it be to write this code and how likely to find a website that will accommodate it?

The photohisting site sounds like a cheaper alternative to purchasing a webpage but not sure if that would require input from me rather than being automated. This needs to display multiple photos a day for a year or more. Photos online can be smaller file size - I will save better copies locally.

Cheers
That's not actually any code - those pages are generated when the permissions are set correctly to allow directory browsing on the server - this is usually disabled for vast majority of websites but is simple to set up, web host support (e.g. TSOHost) should be able to do it for you.

https://support.tigertech.net/directory-index

ETA - basic TSOHost hosting for £14, run a Linux box and you're all set.

Edited by miniman on Friday 15th December 07:56

ecs

1,453 posts

202 months

Friday 15th December 2017
quotequote all
Find a hosting company which supplies you an Apache webserver (loads and loads of them do), make sure they also allow you to use .htaccess to configure it, upload the photos to public_html, www or whatever depending on the setup and create a file called .htaccess in the directory where the photos are stored with the following line in it:

Options +Indexes

That turns on directory listing which is what you want smile

torqueofthedevil

Original Poster:

2,088 posts

209 months

Friday 15th December 2017
quotequote all
miniman said:
torqueofthedevil said:
I think this is closest to what I’m looking for, the page I have seen that runs as I want mine to, has this visible at the top

Index of /

Which looks like a bit of html code which is visible?

Under that it says

Name

And then under that is just a list of the photos (shown as hyperlinks) with the newest on top. How complicated would it be to write this code and how likely to find a website that will accommodate it?

The photohisting site sounds like a cheaper alternative to purchasing a webpage but not sure if that would require input from me rather than being automated. This needs to display multiple photos a day for a year or more. Photos online can be smaller file size - I will save better copies locally.

Cheers
That's not actually any code - those pages are generated when the permissions are set correctly to allow directory browsing on the server - this is usually disabled for vast majority of websites but is simple to set up, web host support (e.g. TSOHost) should be able to do it for you.

https://support.tigertech.net/directory-index

ETA - basic TSOHost hosting for £14, run a Linux box and you're all set.

Edited by miniman on Friday 15th December 07:56
That’s great thanks. On their page they even say they can set it up for you. I do intent to learn but probably best that somebody sets up the first one.

What do you mean by run a Linux box?

Cheers!

HantsRat

2,411 posts

140 months

Friday 15th December 2017
quotequote all
Used this before so that the URL displays a freeze frame from a webcam.

Had some simple software that put a jpg in a folder from the webcam called photo.jpg, I then linked this to a free dropbox account and every 3 mins the photo was overwritten and synced to dropbox.

Then I simply shared the dropboc file to get a URL which always showed the latest image. If you have your own domain you can simple link to this dropbox URL with the jpg and it will always be up to date.

TonyRPH

13,560 posts

200 months

Friday 15th December 2017
quotequote all
OP, are you looking for something like:

this? <<--- clickme

or this? <<--- clickme

If you go for standard listing as some have suggested, you will get this:

Standard listing <<--- click me

Your web host will require PHP for the first two (I can paste the code here if you want it).

The PHP code simply lists all images in a given folder, and displays the relevant images with links to the larger images.

However the first example ideally requires thumbnails (but it can get by without)


torqueofthedevil

Original Poster:

2,088 posts

209 months

Friday 15th December 2017
quotequote all
TonyRPH said:
OP, are you looking for something like:

this? <<--- clickme

or this? <<--- clickme

If you go for standard listing as some have suggested, you will get this:

Standard listing <<--- click me

Your web host will require PHP for the first two (I can paste the code here if you want it).

The PHP code simply lists all images in a given folder, and displays the relevant images with links to the larger images.

However the first example ideally requires thumbnails (but it can get by without)
TonyRPH I actually meant your 3rd link - standard listing. It doesn’t need to be pretty. Is that something I could set up easy enough? Through a regular web provider? Who did you use?

Cheers!

TonyRPH

13,560 posts

200 months

Friday 15th December 2017
quotequote all
torqueofthedevil said:
What do you mean by run a Linux box?
He means a web server running the Linux operating system - these tend to be cheapest to host, because the operating system is free.

A Windows based server will usually cost more because of licence costs.

For your purposes, it doesn't matter which one you choose, although Linux would be better.

torqueofthedevil said:
TonyRPH I actually meant your 3rd link - standard listing. It doesn’t need to be pretty. Is that something I could set up easy enough? Through a regular web provider? Who did you use?

Cheers!
Once you have your hosting, you should have some kind of access (often ftp) to manage files (although some hosting companies will have you use a control panel with built in file management).

As was said above - you will need to create a file called .htaccess (NOTE: the file name is prefixed with a dot) and in that file you want the line:


Options +Indexes


You will also want to delete any files called index.html or index.php (ideally you would want to remove any .html or .php files).

I host my websites on my own servers at home.



torqueofthedevil

Original Poster:

2,088 posts

209 months

Friday 15th December 2017
quotequote all
Ok - I have spoken with 123.-reg

they have said I will need to use hosting for FTP uploads (not web Builder)

I can use Word Press to help "design" this page, rather than pure coding.

There is a free version of Word Press I can have a practice on to see if I can do what I want to do, then if so, I can get a hosting through them.

I might have just repeated what has been said before, and maybe used wrong terminology but I think I know what I'm doing now! I will use the index code info above to try build it.

Cheers

TonyRPH

13,560 posts

200 months

Friday 15th December 2017
quotequote all
You don't need Wordpress for this. (you are getting bad advice from 123reg)

Also - get another hosting company, 123reg.... PAH!!

One and one are good (as are many others) - anyone other than 123reg....

Oh, and Wordpress is free. On any host.

Do not pay for it....

miniman

30,257 posts

294 months

Friday 15th December 2017
quotequote all
TonyRPH said:
You don't need Wordpress for this. (you are getting bad advice from 123reg)

Also - get another hosting company, 123reg.... PAH!!

One and one are good (as are many others) - anyone other than 123reg....

Oh, and Wordpress is free. On any host.

Do not pay for it....
Agree on all this.

torqueofthedevil

Original Poster:

2,088 posts

209 months

Sunday 21st January 2018
quotequote all
Right, I have managed to register a domain with 1&1.

I have managed to make a connection from my camera software which has an ftp uploading facility, to the 1&1 control panel.

I know this as from the control panel I can click on the domain and the folder is today’s date, which is how the camera uploads info.

However, I can’t open that folder to actually view the files.

Also, When I put the web address into explorer it says this domain has only just been registered and displays a generic page.

Is this because it is still going through some sort of registration process, or do I need to do something else? Do I need to create some sort of webpage? Or as discussed above, I don’t want a webpage as such, just want to use the hosting to save photos?

I asked the camera software people if I needed to alter the ht access files and they said unlikely.

It's frustrating as I feel I might need to pay somebody to sort this, but I’m so close to sorting it myself!


TonyRPH

13,560 posts

200 months

Sunday 21st January 2018
quotequote all
If I remember correctly, 1&1 out put a default index.html file in the web root.

You need to rename that, so you can see your files.

There may also be some additional configuration required in the 1&1 control panel to enable viewing of the files (as against serving up a web page).

ETA: Fixed spelling

Edited by TonyRPH on Sunday 21st January 16:12

torqueofthedevil

Original Poster:

2,088 posts

209 months

Sunday 21st January 2018
quotequote all
Ok - hopefully their support will be able to talk me through it / combined with the help I’ve had off here.

One other question.... I have the domain now, and created a subdomain called “test” as I am testing the process out. Will I be able to upload the files to this destination, then when we install at Site 1 have a sub domain for that, and then another for Site 2 etc?

With no links between one page and the other? They don’t have to be completely secure, but basically I wouldn’t really want people from site 1 looking at photos from site 2. If they have a different address with no link from one sub domain to the other, this would be sufficient security.

TonyRPH

13,560 posts

200 months

Sunday 21st January 2018
quotequote all
torqueofthedevil said:
Ok - hopefully their support will be able to talk me through it / combined with the help I’ve had off here.

One other question.... I have the domain now, and created a subdomain called “test” as I am testing the process out. Will I be able to upload the files to this destination, then when we install at Site 1 have a sub domain for that, and then another for Site 2 etc?

With no links between one page and the other? They don’t have to be completely secure, but basically I wouldn’t really want people from site 1 looking at photos from site 2. If they have a different address with no link from one sub domain to the other, this would be sufficient security.
Firstly, how many sub domains you can have on one web hosting will depend on your package however...

In your hosting control panel, you would have something like:


pictures-one.subdomain.com ---> /your_hosting_name/pictures-one/httpdocs

pictures-two.subdomain.com ---> /your_hosting_name/pictures-two/httpdocs

pictures-three.subdomain.com ---> /your_hosting_name/pictures-three/httpdocs


Where "--->" is whatever symbol they use to indicate where the hosting is pointing to.

You usually pay (much) more for this feature.

There are ways around it, however it will remove the security blanket you are expecting to get from your planned method.

You could setup something like:


pictures-one.subdomain.com ---> /your_hosting_name/httpdocs/pictures-one/

pictures-two.subdomain.com ---> /your_hosting_name/httpdocs/pictures-two/

pictures-three.subdomain.com ---> /your_hosting_name/httpdocs/pictures-three/


Then you would put a .htaccess in the web root:


/your_hosting_name/httpdocs/.htaccess


And said .htaccess would contain per sub domain redirects to the appropriate folders.

Something like this might work: (again - depends on what functionality is enabled in your package)


RewriteEngine On
RewriteCond %{HTTP_HOST} ^pictures-one.subdomain.com$
RewriteRule (.*)$ http://subdomain.com/pictures-one/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^pictures-two.subdomain.com$
RewriteRule (.*)$ http://subdomain.com/pictures-two/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^pictures-three.subdomain.com$
RewriteRule (.*)$ http://subdomain.com/pictures-three/$1 [R=301,L]


The caveat attached to this is that if someone goes to http://subdomain.com/ the they will potentially see the sub folders but there are ways around this too (I'll leave you to work it out, but it involves an index.html file...)




Edited by TonyRPH on Sunday 21st January 16:25


Edited by TonyRPH on Sunday 21st January 16:25