Solved

Automatic Image Uploading

Posted on 2016-09-10
9
59 Views
Last Modified: 2016-09-14
Hi Experts,
                 There is a repository of images on a windows PC containing 1000s of images. Some of these images, maybe 100 change everyday, which is an automatic process with no intervention.

The repository of images needs to be reflected to my server which runs PHP, SQL etc..

What I need to be able to do is to send the changes to my server.  In other words I would like to be able to send the timestamp of the local image and compare it with the timestamp of the remote version of the image, if a change has occured I would then overwrite the server version with the local version.

I dont mind opening a webpage to instigate the image updates, but what I cannot do is search for the changed images manually as that would take a very long time.

Is this possible, maybe with HTML5 or even PHP/FTP ?

Many Thanks, ChrisColeman.
0
Comment
Question by:ChrisColeman
  • 4
  • 4
9 Comments
 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 41792640
Beyond Compare can do that, compare and sync source/target folder, even in case the target folder is a ftp url.

Bye, Olaf.
0
 

Author Comment

by:ChrisColeman
ID: 41792769
Olaf, Thanks and looks good - Chris.
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 41792793
I think Beyond Compare is probably the best solution, and it's so inexpensive that it doesn't make sense to write custom software.  

From a theoretical perspective, a version control system like Git might make sense.  If I were going to design something custom, I'd look at using md5() strings for each of the files, instead of dates.  That way, only files that actually had changed content would be flagged.  Restoring a backup might change the file's date/time signature, or the server might be in a different timezone, so a message digest would seem to be a more reliable way to know what changed.
0
 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 41792830
File times typically are in UTC and just translated to system/locale time, but you can compare on raw filetime, where server timezones make no difference.

Beyond Compare offers comparison by content, too, eg by it's crc or binary (full) comparison, though thats obviously not saving the upload or download time.

Few ftp server support xmd5, so Beyond Compare still mainly compares on file meta data you can receive via FTP listing commands. In case you only touch files with a self developed php tool you can use MD5, of course, you can even maintain a database with a record maintaining all meta data you want or need (eg log last upload/download), but once you do manual uploads/deletes your database info is outdated. Beyond Compare rather concentrates on only comparing the files themselves without any support database. Both ways have their pros and cons.

What's perhaps a killer feature of Beyond Compare for you is that it may find similar pictures, even if you have them in different formats and sizes.

Bye, Olaf.
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:ChrisColeman
ID: 41794561
- I'm having a problem with 'Beyond Compare' because I do not wish to keep source images on the server, basically they should be deleted following reduction by PHP/GD - IE. Some of them are rather large.

I'm now thinking of something like --

A) An automated process on windows runs periodically and creates a list of files, directories and timestamps.
B) The automatic process also FTPs the list to my server.
C) On the server a DB contains vital statistics  of images currently active on the server, so I can use the uploaded list to prune deleted images

D) The problem remains to upload new and updated images. What I'm thing of is using FTP again to download a list of required new images from the server (ie. the list was prepared in C. above).

E) Once I have the downloaded list I can I can start an automatic FTP process to upload the list.
F) The newly uploaded images are then processed by PHP/GD (minimised, thumbnailed and source deleted) whenever the website is opened, by anyone.

I know its horribly convoluted - but whaat the heck ?

Any comments .. Chris.
0
 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 41794587
>I do not wish to keep source images on the server
I'm a bit confused. The goal is to upload new or changed images, right?

>processed by PHP/GD (minimised, thumbnailed and source deleted)
Ah, you upload large/original scale images and shrink them serverside. Why? Because you can do it with PHP/GD? Isn't it much simpler and bandwidth friendlier to first resize, then upload?

There are so many image processing programs also on Windows, capable to batch process directories and shrink/web optimise files, why insist on doing that server side with GD?

Once you only have the web size images uploaded, no need to keep the originals merely for syncing not detecting them missing.

Bye, Olaf.
0
 

Author Comment

by:ChrisColeman
ID: 41794849
Actually I didn't even consider that option, probably because i was converting from a website that kep't the source images, but now its so big tht I cannot keep the source images on the server.

Actually that will save a considerable amount bandwidth and processing time too.

I have just looked at irfanview batch processing and I belive that could be what need.

Many Thanks Again - Chris.
0
 
LVL 29

Accepted Solution

by:
Olaf Doschke earned 500 total points
ID: 41794871
In theory, though perhaps Irfanview or Gimps script fu are better options, you could even install PHP client side and use your GD processing.

Bye, Olaf.
0
 

Author Comment

by:ChrisColeman
ID: 41797466
Yes I did consider PHP client side because I already have that, but the client I'm working for does not and it would be a problem for him.

Actually I'm developing this for a disabled person who has diffficulty uploading photos therefore I need to make it seamless as possible.

Hopefully all he needs to do now (or when its complete) is connect up his camera ..

Gimps script fu seems pretty good too.

Thanks.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The viewer will learn how to dynamically set the form action using jQuery.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now