www.webdeveloper.com
Page 20 of 23 FirstFirst ... 101819202122 ... LastLast
Results 286 to 300 of 340

Thread: How to: Upload images using PHP

  1. #286
    Join Date
    Jun 2009
    Posts
    19
    Quote Originally Posted by SyCo View Post
    file max file size has to be set in the php.ini. Possibly in an .htaccess file too. I'm on IIS here so can't tell you for sure.

    The script is for images and uses checks to see it's an image (please see my previous posts in this thread about the insecurity that exists). You would need to remove them and add a file extension check for the type of files you allow.
    ok so i have a script not sure if its like any of the ones here. it lets me upload images to separate files determined by username. my question is, is there a way to display or download them to another computer? im trying to create an admin side of the web site that allows the admin to view uploaded files by username.

  2. #287
    Join Date
    Apr 2007
    Posts
    1,664
    You can display in a browser on any computer by the magic of the interwebs and to download just right click >save as...
    Anti Linux rants are usually the result of a lack of Linux experience, while anti Windows rants are usually a result of a lot of Windows experience.

  3. #288
    Join Date
    Jun 2009
    Posts
    19
    thats not what i ment. i know the admin can use save as. i mean what do i put into my code to display the images that a specific user uploaded? no its not just one image so cant exactly use just a single image tag in the html part. i wont know the number of images each user uploads. currently i am trying to save the image location to the database so i can have access to it, but for some reason it is not actually inserting any info into the database. it is saving the image under the user' folder (username is folder name) and renaming the image. but not saving the image location to the image location to the image table

  4. #289
    Join Date
    Dec 2007
    Posts
    61
    Quote Originally Posted by bokeh View Post
    Have a look at the watermarking code in my signature. It can be used either for outputting or saving the images.



    oh, i got it working! thanks again!!!

  5. #290
    Join Date
    Dec 2007
    Posts
    61
    what if the images i want to upload are in a .zip?
    is it possible to upload a zip and make the script
    extract and work images?

    i remember someone posted a question about that
    but didn't find the post or an answer. sorry to bother
    if that was answered already.

  6. #291
    Join Date
    Jan 2005
    Location
    Alicante (Spain)
    Posts
    7,742

  7. #292
    Join Date
    Jun 2009
    Posts
    19
    ok i have a harder one for you. how do you select a file to zip then download it. i know it can be done because the script i have does it. there are only a few minor problems with it. 1 it saves the zip file to the server not to my desktop and 2 it only inserts the files that i hard code into the script into the zipped file. i want it to download a file that i type into a text box.

    the code i have is posted on another thread here
    http://www.webdeveloper.com/forum/sh...d.php?t=212385

  8. #293
    Join Date
    Mar 2009
    Location
    Texas
    Posts
    124

    adding as many as user wants...

    i have a button that adds as many uploads as they would like to do at once... mostly used for pictures at this time... its a simple div to add in the extra upload dialogs...

    PHP Code:
    <td width="12%" nowrap="nowrap" class="form_text3">
                    <a href="javascript:_add_more();" title="Add more">add more</a> 
                    </td>
                    <td width="88%" class="form_text"><form method="post" enctype="multipart/form-data" id="form">
                    <div id="dvFile">
                      <span class="form_text">
                      <?php  
                          
    for($i=0$i<$numoffile$i++) {
                              print 
    "<input type='file' name='myfiles[]' size='70'><br>";
                          }
                      
    ?>
                        </span></div>
                      <span class="form_text">
                      <input type='submit' name='upload' value='Upload'>
                      </span>
                    </form></td>
    Samantha Morrison
    Knock-Out Web Designs
    http://kowebdesigns.com
    Website Developer/Designer

  9. #294
    Join Date
    Mar 2009
    Location
    Texas
    Posts
    124
    go ahead and make it a sticky so they don't post the questions any more... they can just automatically see it there when they pull up the forums on the first page...
    Samantha Morrison
    Knock-Out Web Designs
    http://kowebdesigns.com
    Website Developer/Designer

  10. #295
    Join Date
    Jul 2009
    Posts
    1

    Question imagePath variable in url to php?

    Newbie issue here... Is it possible to skip the upload form (browse) if you already have the image path? Can I pass the variables directly in the url to the upload_processor.php

    eg.. .myurl.com/upload_image.php?+&File=C:\folder\folder\image.jpg

    I have been able to do this with text (skipping the form), adding to mysql, but not with with an image. Any ideas?
    Thanks, and great script!

  11. #296
    Join Date
    Jan 2005
    Location
    Alicante (Spain)
    Posts
    7,742
    Quote Originally Posted by edented View Post
    Is it possible to skip the upload form (browse) if you already have the image path?
    No, not if you are using a regular browser. The sandbox doesn't allow this behaviour for security reasons.

  12. #297
    Join Date
    Dec 2007
    Posts
    61
    Hi

    is it possible to save in a log file, the full path
    and the original file name on the computer
    uploading the images?

    eg: C:\My Documents\My Pictures\picturename.jpg



  13. #298
    Join Date
    Jan 2005
    Location
    Alicante (Spain)
    Posts
    7,742
    Quote Originally Posted by knightman View Post
    Hi

    is it possible to save in a log file, the full path
    and the original file name on the computer
    uploading the images?

    eg: C:\My Documents\My Pictures\picturename.jpg


    No properly written browser sandbox would allow that.

  14. #299
    Join Date
    Dec 2007
    Posts
    61
    what i meant to say is, make the processor
    save in a txt file, (on server) the full file path
    (on the user's machine), when uploading the file(s).

    i think is something to do with reading
    the "file[]" value(s)... but not sure of what's needed,
    if a hidden input on the form page,
    and/or a $_POST thing on the processor

    thanks 4 ur time!

  15. #300
    Join Date
    Jan 2005
    Location
    Alicante (Spain)
    Posts
    7,742
    Quote Originally Posted by knightman View Post
    what i meant
    I know what you meant. The sandbox will not allow this. Paths to files on clients' PC's is private information.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles