Page 1 of 1

desktop file search

Posted: Thu Jul 01, 2010 3:35 pm
by I_Anderson
I am learning PHP.
I have been given the task of building an application that searches your desktop for a specific file.
I want to be able to enter the file name (ex: scenic.jpg, partially or in it's entirety)
then, it echo out that specific file name and type.
How do I do this??!

Re: desktop file search

Posted: Thu Jul 01, 2010 4:18 pm
by greyhoundcode
One of the steps might include building a list of files/directories within the desktop. What other steps can you think of, and in what order would you place them?

Also, can you clarify if by desktop you mean a given PC's hard drive or merely the Windows Desktop (as in, the icons you see atop the background image)?

Re: desktop file search

Posted: Thu Jul 01, 2010 7:30 pm
by requinix
Umm... searches my desktop? From PHP running on your server?

(and by that I mean "searches the user's desktop", not mine specifically :p)

Re: desktop file search

Posted: Fri Jul 02, 2010 5:22 pm
by I_Anderson
By desktop I mean the users desktop. So the user enters (into a field) either part or the whole name of the file(s) that I'm looking for that exist on the users desktop. Then it would echo out the file(s) that match what the user entered in the field either partially or in it's entirety...or echo a default of 'file not found' if it does not match anything.

I agree, something would have to aggregate the files on the users desktop into a list first. I guess that would be a good place to start.

I feel like scandir() might be part of this process.

I really don't know what I'm doing, but I know that if I can get a bit of guidance, I'll reach a level where I know how to at least structure these things. Prob only take a couple tries. So bare with me!

Re: desktop file search

Posted: Fri Jul 02, 2010 6:05 pm
by Jonah Bron
You can't access the user's filesystem with php. If you could, the world would have gone down the tubes long ago :P

If you want to do this, you'll need something like a Java applet. I think Shockwave can do this too.

Re: desktop file search

Posted: Fri Jul 02, 2010 6:48 pm
by I_Anderson
of course.... that makes a lot of sense. 8O
lol

Re: desktop file search

Posted: Sat Jul 03, 2010 2:10 am
by greyhoundcode
I imagined you meant you were creating a utility in PHP to run on your own machine, or someone else's, rather than via the web.

If that were the case, it would be worth looking at the RecursiveDirectoryIterator object; if not then as per Jonah you might want to try a different language.

Re: desktop file search

Posted: Sat Jul 03, 2010 5:17 pm
by I_Anderson
ya that's more of what I meant. THX
I will look into that