 |
|
 |
|
Next: Work in PHP/Mysql
|
| Author |
Message |
External

Since: Mar 08, 2008 Posts: 8
|
(Msg. 1) Posted: Sun May 04, 2008 6:28 am
Post subject: How_to_display_JPG_files_that_are_stored_on_the_user Archived from groups: comp>lang>php, others (more info?)
|
|
|
I would like to do as follows:
1. The user identifies any directory on his computer.
2. I go through that directory and find all JPG files in it.
3. I display those JPG files.
This is what I know:
1: The input type “file” would let them choose any file in that
directory and send me the complete pathname (the drive, list of
directories leading to it and file name.) I then ignore the file name
at the end and I have the directory.
Is there a way for them to browse to a directory and choose just a
directory instead of a random file within that directory? This is
minor, but still I am only asking for the drive and directories part
of the pathname.
2: I can get a list of the file names in that directory using the
opendir and readdir functions.
3: I go through the list of file names and want to use html IMG to
display the JPG file. This is the real problem. How can I specify
that the SRC is an arbitrary file on their computer? Using the
pathname (drive, directories and file name) doesn’t work.
I can get the contents of the file using the fopen and fread
functions. But how do I specify the contents as the html SRC? Do I
have to save the file contents to the server first? Then would I need
to assign it a file name e.g. “A1”, “A2” etc? And then delete it
after displaying it? And if there is a problem during that process
and it doesn’t run to completion, I have to periodically delete these
“A1” etc. file names that will not be deleted by the process that
created them. How do I tell if it is a file that is currently being
displayed and to not delete it?
Thanks,
P - >> Stay informed about: How_to_display_JPG_files_that_are_stored_on_the_user |
|
| Back to top |
|
 |  |
External

Since: Oct 28, 2007 Posts: 128
|
(Msg. 2) Posted: Sun May 04, 2008 2:38 pm
Post subject: Re: How to display JPG files that are stored on the user’s computer? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
PHPBABY3 wrote:
> I would like to do as follows:
>
> 1. The user identifies any directory on his computer.
> 2. I go through that directory and find all JPG files in it.
> 3. I display those JPG files.
>
> This is what I know:
>
I don't know how you think you "know" this, because what you know is wrong.
PHP runs serverside, it cannot access directories on a user's computer. >> Stay informed about: How_to_display_JPG_files_that_are_stored_on_the_user |
|
| Back to top |
|
 |  |
External

Since: Mar 08, 2008 Posts: 8
|
(Msg. 3) Posted: Sun May 04, 2008 3:28 pm
Post subject: Re:_How_to_display_JPG_files_that_are_stored_on_the_ [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On May 4, 10:46 am, "J.O. Aho" wrote:
> Jerry Stuckle wrote:
> > J.O. Aho wrote:
> >> PHPBABY3 wrote:
> >>> 2: I can get a list of the file names in that directory using the
> >>> opendir and readdir functions.
> >> No you can't, those will only work on the server, not on the client
> >> side, if you want to do something on the client side, then you use a
> >> client side scripting language like javascript.
> > Javascript won't do it, either. Security restrictions will prevent it..
>
> You are right, must been thinking of trusted java applet that can get
> some local file system access, even so, I don't believe it would be a
> good solution.
>
> --
>
> //Aho
Can anyone give me a straight answer as to how I can do what I
describe? I could even pay money for an answer.
P - >> Stay informed about: How_to_display_JPG_files_that_are_stored_on_the_user |
|
| Back to top |
|
 |  |
External

Since: Dec 01, 2003 Posts: 190
|
(Msg. 4) Posted: Sun May 04, 2008 4:17 pm
Post subject: Re:_How_to_display_JPG_files_that [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
PHPBABY3 wrote:
> I would like to do as follows:
>
> 1. The user identifies any directory on his computer.
> 2. I go through that directory and find all JPG files in it.
> 3. I display those JPG files.
>
> This is what I know:
>
> 1: The input type “file” would let them choose any file in that
> directory and send me the complete pathname (the drive, list of
> directories leading to it and file name.) I then ignore the file name
> at the end and I have the directory.
No, you will only get the filename, not the path to the file on the
users hard drive, for this you need to have a normal input (type text)
where they manually enters the path.
> 2: I can get a list of the file names in that directory using the
> opendir and readdir functions.
No you can't, those will only work on the server, not on the client
side, if you want to do something on the client side, then you use a
client side scripting language like javascript.
> 3: I go through the list of file names and want to use html IMG to
> display the JPG file. This is the real problem. How can I specify
> that the SRC is an arbitrary file on their computer? Using the
> pathname (drive, directories and file name) doesn’t work.
file://...
> I can get the contents of the file using the fopen and fread
> functions. But how do I specify the contents as the html SRC? Do I
> have to save the file contents to the server first? Then would I need
> to assign it a file name e.g. “A1”, “A2” etc? And then delete it
> after displaying it? And if there is a problem during that process
> and it doesn’t run to completion, I have to periodically delete these
> “A1” etc. file names that will not be deleted by the process that
> created them. How do I tell if it is a file that is currently being
> displayed and to not delete it?
Uploading images to the server and then display them once is waisting
bandwidth and time. To delete the file after display you would need a
wrapper script that reads the file and then sends the data and then
deletes it when it has sent the whole file, of course if the visitor
would do a reload there wouldn't be any images to display.
There are a lot better ways to display images, just look at such
applications like gqview or kview.
--
//Aho >> Stay informed about: How_to_display_JPG_files_that_are_stored_on_the_user |
|
| Back to top |
|
 |  |
External

Since: Aug 11, 2004 Posts: 3779
|
(Msg. 5) Posted: Sun May 04, 2008 4:17 pm
Post subject: Re:_How_to_display_JPG_files_that [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
J.O. Aho wrote:
> PHPBABY3 wrote:
>> I would like to do as follows:
>>
>> 1. The user identifies any directory on his computer.
>> 2. I go through that directory and find all JPG files in it.
>> 3. I display those JPG files.
>>
>> This is what I know:
>>
>> 1: The input type “file” would let them choose any file in that
>> directory and send me the complete pathname (the drive, list of
>> directories leading to it and file name.) I then ignore the file name
>> at the end and I have the directory.
>
> No, you will only get the filename, not the path to the file on the
> users hard drive, for this you need to have a normal input (type text)
> where they manually enters the path.
>
>
>> 2: I can get a list of the file names in that directory using the
>> opendir and readdir functions.
>
> No you can't, those will only work on the server, not on the client
> side, if you want to do something on the client side, then you use a
> client side scripting language like javascript.
>
Javascript won't do it, either. Security restrictions will prevent it.
>
>> 3: I go through the list of file names and want to use html IMG to
>> display the JPG file. This is the real problem. How can I specify
>> that the SRC is an arbitrary file on their computer? Using the
>> pathname (drive, directories and file name) doesn’t work.
>
> file://...
>
>
>> I can get the contents of the file using the fopen and fread
>> functions. But how do I specify the contents as the html SRC? Do I
>> have to save the file contents to the server first? Then would I need
>> to assign it a file name e.g. “A1”, “A2” etc? And then delete it
>> after displaying it? And if there is a problem during that process
>> and it doesn’t run to completion, I have to periodically delete these
>> “A1” etc. file names that will not be deleted by the process that
>> created them. How do I tell if it is a file that is currently being
>> displayed and to not delete it?
>
> Uploading images to the server and then display them once is waisting
> bandwidth and time. To delete the file after display you would need a
> wrapper script that reads the file and then sends the data and then
> deletes it when it has sent the whole file, of course if the visitor
> would do a reload there wouldn't be any images to display.
>
> There are a lot better ways to display images, just look at such
> applications like gqview or kview.
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex.RemoveThis@attglobal.net
================== >> Stay informed about: How_to_display_JPG_files_that_are_stored_on_the_user |
|
| Back to top |
|
 |  |
External

Since: Dec 01, 2003 Posts: 190
|
(Msg. 6) Posted: Sun May 04, 2008 4:46 pm
Post subject: Re:_How_to_display_JPG_files_that [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Jerry Stuckle wrote:
> J.O. Aho wrote:
>> PHPBABY3 wrote:
>>> 2: I can get a list of the file names in that directory using the
>>> opendir and readdir functions.
>> No you can't, those will only work on the server, not on the client
>> side, if you want to do something on the client side, then you use a
>> client side scripting language like javascript.
> Javascript won't do it, either. Security restrictions will prevent it.
You are right, must been thinking of trusted java applet that can get
some local file system access, even so, I don't believe it would be a
good solution.
--
//Aho >> Stay informed about: How_to_display_JPG_files_that_are_stored_on_the_user |
|
| Back to top |
|
 |  |
External

Since: Dec 01, 2003 Posts: 190
|
(Msg. 7) Posted: Mon May 05, 2008 9:02 pm
Post subject: Re:_How_to_display_JPG_files_that_ [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
PHPBABY3 wrote:
> On May 4, 10:46 am, "J.O. Aho" wrote:
>> Jerry Stuckle wrote:
>>> J.O. Aho wrote:
>>>> PHPBABY3 wrote:
>>>>> 2: I can get a list of the file names in that directory using the
>>>>> opendir and readdir functions.
>>>> No you can't, those will only work on the server, not on the client
>>>> side, if you want to do something on the client side, then you use a
>>>> client side scripting language like javascript.
>>> Javascript won't do it, either. Security restrictions will prevent it.
>> You are right, must been thinking of trusted java applet that can get
>> some local file system access, even so, I don't believe it would be a
>> good solution.
Can anyone give me a straight answer as to how I can do what I
> describe? I could even pay money for an answer.
I thought we had given you a straight answer
1. You can't make it with php, or any other server side script language.
2. You can't do it with client side script language.
3. You better use a stand alone application run on the users computer,
pick one you like from the following page:
http://en.wikipedia.org/wiki/Comparison_of_image_viewers
--
//Aho >> Stay informed about: How_to_display_JPG_files_that_are_stored_on_the_user |
|
| Back to top |
|
 |  |
External

Since: Oct 28, 2007 Posts: 128
|
(Msg. 8) Posted: Mon May 05, 2008 9:17 pm
Post subject: Re: How to display JPG files that are stored on the user's computer? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
PHPBABY3 wrote:
> On May 4, 10:46 am, "J.O. Aho" wrote:
>> Jerry Stuckle wrote:
>> > J.O. Aho wrote:
>> >> PHPBABY3 wrote:
>> >>> 2: I can get a list of the file names in that directory using the
>> >>> opendir and readdir functions.
>> >> No you can't, those will only work on the server, not on the
>> >> client side, if you want to do something on the client side, then
>> >> you use a client side scripting language like javascript.
>> > Javascript won't do it, either. Security restrictions will prevent
>> > it.
>>
>> You are right, must been thinking of trusted java applet that can get
>> some local file system access, even so, I don't believe it would be a
>> good solution.
>>
>> --
>>
>> //Aho
>
> Can anyone give me a straight answer as to how I can do what I
> describe? I could even pay money for an answer.
>
> P -
You have had lots of straight answers. I tell you again, what you say you
know is all wrong. You cannot do it. Period! >> Stay informed about: How_to_display_JPG_files_that_are_stored_on_the_user |
|
| Back to top |
|
 |  |
External

Since: Feb 08, 2008 Posts: 21
|
(Msg. 9) Posted: Tue May 06, 2008 8:37 am
Post subject: Re:_How_to_display_JPG_files_that_are_stored_on_the_ [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On May 4, 9:28 am, PHPBABY3 wrote:
> I would like to do as follows:
>
> 1. The user identifies any directory on his computer.
> 2. I go through that directory and find all JPG files in it.
> 3. I display those JPG files.
>
> This is what I know:
>
> 1: The input type “file” would let them choose any file in that
> directory and send me the complete pathname (the drive, list of
> directories leading to it and file name.) I then ignore the file name
> at the end and I have the directory.
>
> Is there a way for them to browse to a directory and choose just a
> directory instead of a random file within that directory? This is
> minor, but still I am only asking for the drive and directories part
> of the pathname.
>
> 2: I can get a list of the file names in that directory using the
> opendir and readdir functions.
>
> 3: I go through the list of file names and want to use html IMG to
> display the JPG file. This is the real problem. How can I specify
> that the SRC is an arbitrary file on their computer? Using the
> pathname (drive, directories and file name) doesn’t work.
>
> I can get the contents of the file using the fopen and fread
> functions. But how do I specify the contents as the html SRC? Do I
> have to save the file contents to the server first? Then would I need
> to assign it a file name e.g. “A1”, “A2” etc? And then delete it
> after displaying it? And if there is a problem during that process
> and it doesn’t run to completion, I have to periodically delete these
> “A1” etc. file names that will not be deleted by the process that
> created them. How do I tell if it is a file that is currently being
> displayed and to not delete it?
>
> Thanks,
>
> P -
PHPBABY,
Are you attempting to write a client-side application using PHP do
what you are asking? (ie. are you writing PHP-GTK to achieve this?)
Steve >> Stay informed about: How_to_display_JPG_files_that_are_stored_on_the_user |
|
| Back to top |
|
 |  |
External

Since: Mar 08, 2008 Posts: 8
|
(Msg. 10) Posted: Sat Jun 07, 2008 7:37 am
Post subject: Re: How to display JPG files that are stored on the user's computer? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On May 5, 4:17 pm, "Paul Lautman" wrote:
> PHPBABY3 wrote:
> > On May 4, 10:46 am, "J.O. Aho" wrote:
> >> Jerry Stuckle wrote:
> >> > J.O. Aho wrote:
> >> >> PHPBABY3 wrote:
> >> >>> 2: I can get a list of the file names in that directory using the
> >> >>> opendir and readdir functions.
> >> >> No you can't, those will only work on the server, not on the
> >> >> client side, if you want to do something on the client side, then
> >> >> you use a client side scripting language like javascript.
> >> > Javascript won't do it, either. Security restrictions will prevent
> >> > it.
>
> >> You are right, must been thinking of trusted java applet that can get
> >> some local file system access, even so, I don't believe it would be a
> >> good solution.
>
> >> --
>
> >> //Aho
>
> > Can anyone give me a straight answer as to how I can do what I
> > describe? I could even pay money for an answer.
>
> > P -
>
> You have had lots of straight answers. I tell you again, what you say you
> know is all wrong. You cannot do it. Period!
Some people say I can. PHP can invoke other languages.
- Hide quoted text -
>
> - Show quoted text - >> Stay informed about: How_to_display_JPG_files_that_are_stored_on_the_user |
|
| Back to top |
|
 |  |
External

Since: Aug 11, 2004 Posts: 3779
|
(Msg. 11) Posted: Sat Jun 07, 2008 10:41 am
Post subject: Re: How to display JPG files that are stored on the user's computer? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
PHPBABY3 wrote:
> On May 5, 4:17 pm, "Paul Lautman" wrote:
>> PHPBABY3 wrote:
>>> On May 4, 10:46 am, "J.O. Aho" wrote:
>>>> Jerry Stuckle wrote:
>>>>> J.O. Aho wrote:
>>>>>> PHPBABY3 wrote:
>>>>>>> 2: I can get a list of the file names in that directory using the
>>>>>>> opendir and readdir functions.
>>>>>> No you can't, those will only work on the server, not on the
>>>>>> client side, if you want to do something on the client side, then
>>>>>> you use a client side scripting language like javascript.
>>>>> Javascript won't do it, either. Security restrictions will prevent
>>>>> it.
>>>> You are right, must been thinking of trusted java applet that can get
>>>> some local file system access, even so, I don't believe it would be a
>>>> good solution.
>>>> --
>>>> //Aho
>>> Can anyone give me a straight answer as to how I can do what I
>>> describe? I could even pay money for an answer.
>>> P -
>> You have had lots of straight answers. I tell you again, what you say you
>> know is all wrong. You cannot do it. Period!
>
> Some people say I can. PHP can invoke other languages.
>
>
Then go ask those people how to do it!
> - Hide quoted text -
>> - Show quoted text -
>
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex DeleteThis @attglobal.net
================== >> Stay informed about: How_to_display_JPG_files_that_are_stored_on_the_user |
|
| Back to top |
|
 |  |
External

Since: Oct 28, 2007 Posts: 128
|
(Msg. 12) Posted: Sat Jun 07, 2008 5:30 pm
Post subject: Re: How to display JPG files that are stored on the user's computer? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Jerry Stuckle wrote:
> PHPBABY3 wrote:
>> On May 5, 4:17 pm, "Paul Lautman"
>> wrote:
>>> PHPBABY3 wrote:
>>>> On May 4, 10:46 am, "J.O. Aho" wrote:
>>>>> Jerry Stuckle wrote:
>>>>>> J.O. Aho wrote:
>>>>>>> PHPBABY3 wrote:
>>>>>>>> 2: I can get a list of the file names in that directory using
>>>>>>>> the opendir and readdir functions.
>>>>>>> No you can't, those will only work on the server, not on the
>>>>>>> client side, if you want to do something on the client side,
>>>>>>> then you use a client side scripting language like javascript.
>>>>>> Javascript won't do it, either. Security restrictions will
>>>>>> prevent it.
>>>>> You are right, must been thinking of trusted java applet that can
>>>>> get some local file system access, even so, I don't believe it
>>>>> would be a good solution.
>>>>> --
>>>>> //Aho
>>>> Can anyone give me a straight answer as to how I can do what I
>>>> describe? I could even pay money for an answer.
>>>> P -
>>> You have had lots of straight answers. I tell you again, what you
>>> say you know is all wrong. You cannot do it. Period!
>>
>> Some people say I can. PHP can invoke other languages.
Those 2 things are unconnected. The people who say you can are wrong. php
can invoke programs written in other languages, but it does so on the
server, not on the client.
Still as Jerry says, ask the people who say you can, then share your new
wisdom. >> Stay informed about: How_to_display_JPG_files_that_are_stored_on_the_user |
|
| Back to top |
|
 |  |
External

Since: Feb 28, 2008 Posts: 940
|
(Msg. 13) Posted: Sat Jun 07, 2008 5:30 pm
Post subject: Re: How to display JPG files that are stored on the user's computer? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
>> PHPBABY3 wrote:
>>> On May 5, 4:17 pm, "Paul Lautman"
>>> wrote:
>>>> PHPBABY3 wrote:
>>>>> On May 4, 10:46 am, "J.O. Aho" wrote:
>>>>>> Jerry Stuckle wrote:
>>>>>>> J.O. Aho wrote:
>>>>>>>> PHPBABY3 wrote:
>>>>>>>>> 2: I can get a list of the file names in that directory using
>>>>>>>>> the opendir and readdir functions.
>>>>>>>> No you can't, those will only work on the server, not on the
>>>>>>>> client side, if you want to do something on the client side,
>>>>>>>> then you use a client side scripting language like javascript.
>>>>>>> Javascript won't do it, either. Security restrictions will
>>>>>>> prevent it.
>>>>>> You are right, must been thinking of trusted java applet that can
>>>>>> get some local file system access, even so, I don't believe it
>>>>>> would be a good solution.
>>>>>> --
>>>>>> //Aho
>>>>> Can anyone give me a straight answer as to how I can do what I
>>>>> describe? I could even pay money for an answer.
>>>>> P -
You know, "some people" have told me that you can fry an egg in a
working refrigerator. I have not been able to do it yet. "Can anyone
give me a straight answer as to how I can do what I describe? I could
even pay money for an answer."
Do you know a good definition of insanity? One might be "repeating
attempts to do the impossible, and expecting a different outcome". >> Stay informed about: How_to_display_JPG_files_that_are_stored_on_the_user |
|
| Back to top |
|
 |  |
External

Since: Oct 28, 2007 Posts: 128
|
(Msg. 14) Posted: Sat Jun 07, 2008 10:43 pm
Post subject: Re: How to display JPG files that are stored on the user's computer? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
sheldonlg wrote:
>
> You know, "some people" have told me that you can fry an egg in a
> working refrigerator. I have not been able to do it yet. "Can anyone
> give me a straight answer as to how I can do what I describe? I could
> even pay money for an answer."
>
> Do you know a good definition of insanity? One might be "repeating
> attempts to do the impossible, and expecting a different outcome".
Why are you replying to my post? >> Stay informed about: How_to_display_JPG_files_that_are_stored_on_the_user |
|
| Back to top |
|
 |  |
External

Since: Oct 21, 2007 Posts: 318
|
(Msg. 15) Posted: Sun Jun 08, 2008 11:28 am
Post subject: Re: How to display JPG files that are stored on the user's computer? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
sheldonlg wrote:
>
> You know, "some people" have told me that you can fry an egg in a
> working refrigerator. I have not been able to do it yet. "Can anyone
> give me a straight answer as to how I can do what I describe? I could
> even pay money for an answer."
>
You use a portable camp stove, silly.
And I claim my £5.
> Do you know a good definition of insanity? One might be "repeating
> attempts to do the impossible, and expecting a different outcome".
No, that's normal for most people in denial, or with religious conviction. >> Stay informed about: How_to_display_JPG_files_that_are_stored_on_the_user |
|
| Back to top |
|
 |  |
| Related Topics: | PHPtriad v2.2.1 removal - When I fist started using apache/php/mysql I used phptriad [a wonderful piece of kit] to get me up and running. I've used this ever since. I'm think inow of 'upgrading' to laters versions of all three applications, and have found various tutorials/Ho...
MySQL regular expression to match a imploded item - Hello I need to use MySQL's REGEXP (POSIX compliant) to search registries where one field is an imploded set of integer values separated with pipes "|". I need to match one of these imploded values directly on a sql select. $sql = "SELECT...
Weird mysql_connect problem - Hello. My mysql_connect just started to give me following error today, Fatal error: Call to undefined function: mysql_connect() in ..../database_functions/db_functions.inc.php on line 11. So it seems that my php no longer finds php-mysql module...
MySQL - question about displaying data - I am working an some pages that have database content on them. I'm sorry that I don't have any versions of it online yet, but it isn't hard to explain. The site lists restaurants with contact information. All of the information is kept in a MySQL..
How can i Optimize sql Query ? - Hi, I'd like to optimize this query: Code: SELECT * FROM `links` WHERE active = "1" AND mainweight != 0 ORDER BY Rand()*(1/mainweight) LIMIT 5 I have a database of links wich has 3 000 rows. I'd like to select weighted random links from ... |
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
 |
|
|