Hi there, Can anybody help me to write php/javascript code which will allow users to open files directly from web browser into desktop application? Here is the specification: I have a photo editing business with many people working in Photoshop. I am currently developing a web based application (joblist) using Javascript and PHP which should allow the photoshop designers to browse and open files/images directly from joblist/web browser into photoshop. The reason I want this instead of browsing folder is that I have a database where I store who worked on which file, when and how long it took. The concept is that, designers will select a file and click on start, as soon as they click on start the original file will open in Photoshop and there will be an entry into database (using PHP). Once they finish the task they will close the file and click on Finish button. My joblist application will be published in a local server and the file will be open on a local network, so when they save the file it will be saved where the source file is located in (local server). The application should work in both PC and Mac. I have already done all other part of the application except file opening directly from browser to desktop application functionality. Anybody can help me to write the code (PHP or Javascript) which can open the file from browser (local server) directly into desktop application e.g. PHotoshop or Illustrator? Thank you very much I look forward to someone's real help! Best regards Mr. Sumon www.clippingpathindia.com
The program used to open certain filetypes isn't handled, and can't be handled by the website. It is a user preferenced stored and managed by the users personal computer. For example, if I were to open a .psd file off your website, my computer would have to know to associate that file extension with Photoshop. There is no way to change that preference on the users computer from a website.
Filetype is actually is not a matter, if a permanent command is given to each file that it should be opened to photoshop whatever the file-format is no matter if any file is not photoshop recognised and can't open photoshop. If you can tell me the code which will open each file to users computer photoshop program that would be really good. Thanks.
That's just it though...there is no code that you can use to tell the computer to open a program as that would be an extremely high security risk for anyone owning a computer.
Is this what you're looking for? function runProgram() { var file = ""; var shell = new ActiveXObject("WScript.shell"); shell.run(file); shell.quit; shell = null; } Code (markup): This should ask the person if they would like to run the program for obvious reasons.
Hi System_, Thank you very much for your code. Is this a javascript or php code. And where do you mention to open the file in Photoshop etc.? I had to ask that type of stupid question because I am not a expert programmer. Thank you.
Wow, I didn't even know you could do that. Unfortunately I think it will only work on a windows machine and if they have photoshop installed in the proper location.
I think he basically wants to build an office and create a working environment for his employees, so we can safely assume he has complete control over the browser settings and so forth. If this is what you want to do, here is what you would have to do. When your employees want to download a file, they will have to click a link to a php script containing the following code: <?php $filename = $_GET['file']; header('Content-Disposition: attachment; filename="' . $filename . '"'); echo file_get_contents("filestorage/" . $filename); ?> PHP: Firefox will then open the file with whatever application is set for handling the files file type. If you just set Photoshop as the standard for handling that file type, it will automatically start up Photoshop. You probably know that from your regular browser usage; at least I do (in Firefox). Whenever I browse to a .itms file, it will automatically fire up the iTunes Store, or when I open a PDF, it opens it in the Acrobat Reader(the default is to open the file within Firefox using the Adobe Acrobat plugin, but you can set it to open it in the real Acrobat Reader). This does, however, not solve the second part of your problem: The re-upload of the finished file. I'm not really sure how to solve this problem. The simplest solution would probably be to have your designers save the file somewhere and upload it manually through a web form. Other (possible) solutions: - Some big programs allow you to write extensions for them, so you can basically add buttons to them. I don't know if Photoshop is one of them, but it might be worth a shot. - I have a Firefox extension named FireFTP. It's an FTP client. When I open a file, it starts up a application of my choice, and whenever I save changes to the file, it will automatically upload the new file to the server. I don't know how it does that. It's probably a greasemonkey script (the language used for Firefox plugins), and certainly not PHP or JavaScript code. But it's exactly what you need. If you figure out how it works, please tell me how. I would be very interested in that. If you have any other questions don't hesitate to PM me or ask here.
Hi Thomas, Thanks for your detailed email. yes you are right, I just need the application for own use, within a single office so i have control over all the computer browser. Very good idea you have told me, that firefox can open the file directly into photoshop. I just tried it and it worked just perfectly. First time the problem was that it downloaded the file into own computer then open it into photoshop which I don't need, I want to work within the network so file will be opened from the local computer and when save it will be saved into the same computer. I have also got a solution for that. I can do it this way: Instead of write the url : //localhost:8888/ if I write the local computer network address like \\Server\macintosh hd2\filename.psd (mac server) in the browser it opens the file directly into chosen application without downloading into own pc. So that way I got the solution. Now I need the following things to be done. As told earlier I have developed a joblist where all my client's jobs are listed. When any designer click on any job in the joblist, it will bring a next page where all the images of that job will be listed, beside each image there will be two button called "Start" and "Finish". when the Start button is clicked the file will be opened into photoshop and at the same time there will be an entry into database with the jobid, userid, clientid, current time etc. and once the image editing is completed the user will close it and click on the finish button. then the database will be updated with adding the finish time. In addition to that I also want that when someone start working on a file, the file will be moved to another folder called "processing" and once click on finish button it will be moved to "finished" folder. And once a user start working on an image it will be invisible to other users, so that more than one user can't work into one file at the same time. If you think no need to have the start and finish button instead we can use the php file system functions to understand automatically when the file was open and last saved etc. please also suggest. All I want is a application which will make our total working environment very easy and flexible. keep record of all the things into database. and no two people can work on the same file at the same time. So if you have any suggestions please let me know. My website is : www dot clippingpathindia dot com. Visit it, you may like it. If you need any photo editing service can make a request, I will have special discount for you. Thanks.
Thats a smart solution. I like it. I would advise you to ditch the whole folder thing. Do it in a database. You already have a database that stores all the images in a job. Simply add another database field for each of these images. Call it "status", and write the status into it. In your example, that would be "new", "processing", "done" (Don't use words, use status numbers like 1, 2, 3 for that. It's much faster.). When showing the images left in a job, you only show the ones with "new". This will also allow you to query your database for all completed images, or all images that are currently being processed.
Thank you for your nice suggestions which I think is best. But I think it requires writing lot of code because inside the root folder can be subfolder too so that should also be stored into database in a way so that can be retrieved in the browser. Do you know any plugin or library (php) which can do this? I am not a expert php writer so I think it will be a bit hard for me to do this. If it is hard can we go for something like, the browser will show files from the folder (without storing into database) and once a file is click (start work) then it goes into database and at the same the the file is transferred into another folder called "processing"? Which one will be easier and best? I am also now running into another problem. when I put a link into a file something like file:///Users/sumon/deart-spread.psd. It doesn't work, I mean the url doesn't change from http to file. I tried putting different target but none worked. Any idea how I can achieve this?
In regards to your first problem: Do it with a database. It's always a better solution, because it can be used more easily. It will certainly help you a lot later in the project. As far as I know, there is no library for that. It's not a job for a PHP beginner, but it's not difficult to do. But if you are dedicated to doing it, it's certainly something a beginner can do. There are lots of tutorials out there, and lots of forums like this to ask more experienced people. You can also hire someone to do it. I can certainly help you with that. I don't really understand what your second problem is. In your post above, you say entering "\\Server\macintosh hd2\filename.psd" directly into your browser will work. Have you tried using the below HTML code? <a href="\\Server\macintosh hd2\filename.psd">Click me!</a> Code (markup):
Thanks for the suggestions in the first issue. I will go for it. I think I can do it as I am working on it dedicatedly. But if I need your help I will let you know. Regarding the big problem I am facing now. The forum is not allowing me to write url here so I have to tell you in other ways. When I am in my joblist, the url in the browser starts with http:// right? But when I want to open any file directly into photoshop without downloading (from another computer within network) I have to use the url which starts with file://///computername/foldername/filename. But when I put this url in the html code and in the browser click on the link it does not work. Nothing happens. That means it does not allow to change the url from "http://" to "file://///". Am I clear now? If not please let me know and I will try to clarify again. Thanks.
Jesus this is becoming tricky. I've done some testing on the subject. Regular, working link I can copy into Windows Explorer: \\PCNAME\SharedDocs\test.txt Firefox Link: file://///PCNAME/SharedDocs/test.txt HTML: <a href="file://///PCNAME/SharedDocs/test.txt">click!</a> Code (markup): All of the above examples work just fine. Tested using Firefox, both devices are regular PCs running WinXP. As for your problem... woah, thats really tricky now. Try to navigate to the folder on the server using your computer's regular file explorer. Open a file. If it works, go back to the folder, right-click the file and open it with Firefox or whatever your browser is. Does it work then? What does the address look like? What I'm doing right here is advanced IT counseling by someone who knows what he is doing. Someone just PMed me, asking me to stop doing it for free, in public, because he believes its significantly lowering the price people are willing to pay for his work. Therefore, I've PMed you my email address.