Clicky

Hi Guys,

How do you have a website integrate to a desktop application?

I mean if i needed to have a desktop application perform a task on a file that was uploaded via a website, and the display back on the website how would you do this?

E.g.  Upload photo via website -> Photoshop performs task on file -> Photo is displayed back in website

I'm used to coding in PHP, MySQL, Apache environment.

Thanks for any tips in advance.

Cheers

asked 11/27/2011 09:28

dev09's gravatar image

dev09 ♦♦


2 Answers:
Greetings dev09,

In order to answer this question I have to make sure you understand the term “client-server model”. A client server model is where a client requests information to a server, the server gets the requirement, and provides an answer to it.

A simple example of this model is a bank; you are a client that request s information to the bank (i.e. balance, transactions), and the bank provides you with that information.

Now, let’s say that you want to google something. You fire up your favorite browser (Chrome for the sake of this example), type www.google.com in the navigation bar and press enter. This process is the same as you and the bank; in this case, it’s your browser the one that’s requesting information about www.google.com, which a specific server answers (won’t go through domain specifics) and then provides you with the text, pictures and features that google.com has.

As you are using PHP and Apache, you by now should understand that Apache is a web server; what you code is returned by Apache and browsed by your browser (no pun intended).
That being said, if you want to have a desktop application integrate with a desktop app, you need to code a CLIENT that REQUESTS information to your SERVER (Apache) and code in your SERVER the answer to that specific request.

There are many ways to do that, it really depends in your needs. For instance, I have a CLIENT application in PHP (let’s say that’s inside a file called client.php in my Apache environment) that requires information from the Twitter SERVER. Using cURL (http://en.wikipedia.org/wiki/CURL). That way, when I got to my localhost/www/client.php, the code requests the info to Twitter and sends it back.

I’ll give you one more examples. Evernote (http://evernote.com/), a note-sharing tool, has a client application for Mac and Windows. This application, probably coded in C/C++ or C#, works as a CLIENT that sends updates to the Evernote.com webpage every singled time a user makes a change. This specific design pattern is called Observer Pattern (http://en.wikipedia.org/wiki/Observer_pattern). The programmers of the client had to make sure that the application would update to the SERVER any change made in the CLIENT.

(I hope this haven’t been too long, I’m almost done!)

Let’s go to your example, and I’ll show you multiple ways to solveit. I’m a photoediting enterprise that hired a couple of designers in order to retouch any picture uploaded by my users in real-time. How would I do that? One option would be to create an application that allows my users to upload the files in the SERVER. (www.retouchyourfiles.com). When a user uploads a photo, the application sends an email to one of my photoeditors with the picture to edit. He downloads the picture from his/her email, retouches it, and then goes to the photoeditors section in the application to uploade the retouched version. (www.retouchyourfiles.com/admin. Obviously you would need a database and protected section). In this case, you really didn’t need a desktop client, yet you managed to solve the problem.

With a desktop application, you would need to code a web service (http://en.wikipedia.org/wiki/Web_service) that provides you with information on the files that had been uploaded. You would need to code functions like getLatestPictures, sendTouchedPictures, notifyUsers, notifyPhotoEditors and so on. This desktop application could be made with Java, PHP, .NET, Python, it doesn’t matter, as long as your SERVER can handle the REQUESTS of the client. That’s how many enterprises port multiple desktop applications for its services; they are just different clients that request the same information multiple times.

I hope the answer wasn’t too long or too boring and that it actually helped you to understand the topic.
Best regards,

-JJ
link

answered

jjperezaguinaga's gravatar image

jjperezaguinaga

You need an upload page with a script on the server to process it.

You are not going bring it into photoshop and then go back to the page with it.  Can't be done.  You have to bring in the uplad page from the server and use a form.
link

answered 2011-11-27 at 18:02:14

COBOLdinosaur's gravatar image

COBOLdinosaur

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×1
×104
×81
×191
×15

Asked: 11/27/2011 09:28

Seen: 394 times

Last updated: 12/15/2011 09:00