Bluehost.com Web Hosting $6.95

How to display JPG files that are stored on the user’s computer?

This is a discussion on How to display JPG files that are stored on the user’s computer? within the PHP General forums, part of the PHP Programming Forums category; On May 5, 4:17*pm, "Paul Lautman" <paul.laut...@btinternet.com> wrote: > PHPBABY3 wrote: &...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 06-07-2008
PHPBABY3
 
Posts: n/a
Default Re: How to display JPG files that are stored on the user's computer?

On May 5, 4:17*pm, "Paul Lautman" <paul.laut...@btinternet.com> wrote:
> PHPBABY3 wrote:
> > On May 4, 10:46 am, "J.O. Aho" <u...@example.net> 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 -


Reply With Quote
  #12 (permalink)  
Old 06-07-2008
Jerry Stuckle
 
Posts: n/a
Default Re: How to display JPG files that are stored on the user's computer?

PHPBABY3 wrote:
> On May 5, 4:17 pm, "Paul Lautman" <paul.laut...@btinternet.com> wrote:
>> PHPBABY3 wrote:
>>> On May 4, 10:46 am, "J.O. Aho" <u...@example.net> 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@attglobal.net
==================

Reply With Quote
  #13 (permalink)  
Old 06-07-2008
Paul Lautman
 
Posts: n/a
Default Re: How to display JPG files that are stored on the user's computer?

Jerry Stuckle wrote:
> PHPBABY3 wrote:
>> On May 5, 4:17 pm, "Paul Lautman" <paul.laut...@btinternet.com>
>> wrote:
>>> PHPBABY3 wrote:
>>>> On May 4, 10:46 am, "J.O. Aho" <u...@example.net> 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.


Reply With Quote
  #14 (permalink)  
Old 06-07-2008
sheldonlg
 
Posts: n/a
Default Re: How to display JPG files that are stored on the user's computer?

>> PHPBABY3 wrote:
>>> On May 5, 4:17 pm, "Paul Lautman" <paul.laut...@btinternet.com>
>>> wrote:
>>>> PHPBABY3 wrote:
>>>>> On May 4, 10:46 am, "J.O. Aho" <u...@example.net> 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".
Reply With Quote
  #15 (permalink)  
Old 06-07-2008
Paul Lautman
 
Posts: n/a
Default Re: How to display JPG files that are stored on the user's computer?

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?


Reply With Quote
  #16 (permalink)  
Old 06-08-2008
The Natural Philosopher
 
Posts: n/a
Default Re: How to display JPG files that are stored on the user's computer?

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.
Reply With Quote
  #17 (permalink)  
Old 06-08-2008
Hiker123
 
Posts: n/a
Default Re: How to display JPG files that are stored on the user’s computer?

You've had a lot of replies saying that you can not
do this in PHP

While the PHP Script can't do it alone,
you can embed client side code to meet the need.
Several users suggested Java.

If you are open to an ActiveX solution ( requires browser
to be IE on Windows system ) then this becomses easy.
Our MetaDraw control can display local ( or remote)
JPGs ( or other image formats ) within a scrollable,
zoomable client side window. Also in Active X it
is easy to handle the directory listing and file
deletions ( if allowed by the user ).

If you are interested, contat me at
Jeff AT Bennet-Tec.com

============================

On May 4, 9:28*am, PHPBABY3 <shymath...@gmail.com> 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 -


Reply With Quote
  #18 (permalink)  
Old 06-09-2008
GuangXiN
 
Posts: n/a
Default Re: How to display JPG files that are stored on the user's computer?

think about other client side techs, such as vbscript and activex, this
may not be able to work with firefox and other non-ie browsers.
Reply With Quote
  #19 (permalink)  
Old 06-09-2008
Gordon
 
Posts: n/a
Default Re: How to display JPG files that are stored on the user's computer?

On Jun 7, 3:37 pm, PHPBABY3 <shymath...@gmail.com> wrote:
> On May 5, 4:17 pm, "Paul Lautman" <paul.laut...@btinternet.com> wrote:
>
>
>
> > PHPBABY3 wrote:
> > > On May 4, 10:46 am, "J.O. Aho" <u...@example.net> 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 -


Some people are wrong.
Reply With Quote
  #20 (permalink)  
Old 06-09-2008
Jerry Stuckle
 
Posts: n/a
Default Re: How to display JPG files that are stored on the user's computer?

GuangXiN wrote:
> think about other client side techs, such as vbscript and activex, this
> may not be able to work with firefox and other non-ie browsers.
>


And even if you use them, the user has to give permission for the script
to access his/her disk - which no intelligent user will do. And it
won't work on non Windoze systems.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 05:23 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0