Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    May 2013
    Posts
    21
    Member #
    36225
    Liked
    4 times
    Say i wanted to create an "Open file" command. like to choose a file from the directory, how would i go about doing that? I need it to open a window, just like any other program would, they would click on an image for example, and the image name would be returned to me.



    For example:

    1.) Click on a button (CLICK ME TO CHOOSE IMAGE)
    2.) Opens the folder of the web server where my images are stored.
    3.) If possible (but not necessary) lock the location wherein he/she cannot move away from that folder.
    4.) Choose a file (i.e. image.png)
    5.) returns name of the image (i.e image.png)


    Thanks in advance!

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,716
    Member #
    5580
    Liked
    718 times
    The easy answer is to Google: PHP upload photo

    The hard answer is to say, you can limit filetypes, filesizes, filenames, who can upload (login), and many other things. PHP can also alter photos before they are saved (resize, crop, watermark, etc).

    There is no way to really answer your question using this forum ... too many variables.


  4. #3
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    I think what he's saying is that he wants a script to run when an image (probably a thumbnail) is clicked on a website, that would open the image from a specific folder in a new window, and send the information about which image was viewed back to him, so he can keep track.

    In non-code language, it would be like this:

    if (image clicked) then open (folder/image) in new window and send (info_about_click) to (site_owner).

    I don't read anything about uploading an image in the question - or have I got it wrong?
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,716
    Member #
    5580
    Liked
    718 times
    Yes, I think I read it wrong.


  6. #5
    Junior Member
    Join Date
    May 2013
    Posts
    21
    Member #
    36225
    Liked
    4 times
    thanks for the replies guys, i actually solved the problem by thinking up another solution,

    but to clear things up, it wasnt a file upload question it was actually more of a way to list all files in a specific folder (in the server) to a window.

    but thanks anyways!

  7. #6
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    Glad you solved your issue - care to share the solution? It may help others.
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  8. #7
    Junior Member
    Join Date
    May 2013
    Posts
    21
    Member #
    36225
    Liked
    4 times
    Well it wasn't a solution, id call it more of a compromise. I simply listed all the images in a div and made them clickable and from there, executed my code.

  9. #8
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    Thanks for sharing that. In fact, that is probably a far more secure way to do it than allowing access to a folder on the site.
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  10. #9
    Junior Member
    Join Date
    Jun 2013
    Posts
    1
    Member #
    36521
    The fopen functionis used in php to open the file. First, we must supply it with the name of the file that we want it to open. Secondly, we must tell the function what we plan on doing with that file (i.e. read from the file, write information, etc).

    Syntax:-
    fopen($ourFileName, 'w');


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:33 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com