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??!
desktop file search
Moderator: General Moderators
- greyhoundcode
- Forum Regular
- Posts: 613
- Joined: Mon Feb 11, 2008 4:22 am
Re: desktop file search
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)?
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
Umm... searches my desktop? From PHP running on your server?
(and by that I mean "searches the user's desktop", not mine specifically :p)
(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
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!
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!
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: desktop file search
You can't access the user's filesystem with php. If you could, the world would have gone down the tubes long ago 
If you want to do this, you'll need something like a Java applet. I think Shockwave can do this too.
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
of course.... that makes a lot of sense.
lol
lol
- greyhoundcode
- Forum Regular
- Posts: 613
- Joined: Mon Feb 11, 2008 4:22 am
Re: desktop file search
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.
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
ya that's more of what I meant. THX
I will look into that
I will look into that