desktop file search

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
I_Anderson
Forum Newbie
Posts: 4
Joined: Thu Jul 01, 2010 2:55 pm

desktop file search

Post 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??!
User avatar
greyhoundcode
Forum Regular
Posts: 613
Joined: Mon Feb 11, 2008 4:22 am

Re: desktop file search

Post 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)?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: desktop file search

Post 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)
I_Anderson
Forum Newbie
Posts: 4
Joined: Thu Jul 01, 2010 2:55 pm

Re: desktop file search

Post 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!
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: desktop file search

Post 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.
I_Anderson
Forum Newbie
Posts: 4
Joined: Thu Jul 01, 2010 2:55 pm

Re: desktop file search

Post by I_Anderson »

of course.... that makes a lot of sense. 8O
lol
User avatar
greyhoundcode
Forum Regular
Posts: 613
Joined: Mon Feb 11, 2008 4:22 am

Re: desktop file search

Post 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.
I_Anderson
Forum Newbie
Posts: 4
Joined: Thu Jul 01, 2010 2:55 pm

Re: desktop file search

Post by I_Anderson »

ya that's more of what I meant. THX
I will look into that
Post Reply