PHP and file uploads

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default PHP and file uploads

    Hi All,

    Here's one thing that I don't know much about - file uploading. As part of
    my project, I will have to build a file manager of sorts - perhaps a
    document manager. Anyhow, this involves allowing my user to upload files to
    a location.

    I know PHP can do it - I know this because it sure does everything else ...
    but I don't know this from any authoritative source.

    So ... can you tell me if PHP can handle files uploads, and if so, what are
    the drawbacks that you might have learned of in your experience? For
    instance, in the ASP world, using a COM object for the upload works, but
    apparently has significant impact on performance.

    So anyway, advise (advice???) me ...

    Thanks,
    Santosh


    OneSolution Guest

  2. Similar Questions and Discussions

    1. Web File uploads
      While trying to do a simple file upload via a web form, (enctype="multipart/form-data"), I've run into a problem that has me stymied. This is an...
    2. Specify temp directory and file name for file uploads?
      I'm interested in understanding how MX processes file uploads. 1) By default, uploaded files seem to be placed in the...
    3. File Uploads
      Hello You must use <form action="uploadItem.php" method="post" enctype="multipart/form-data"> gerwazy POLAND
    4. #24919 [Com]: PHP File Uploads in RAM
      ID: 24919 Comment by: jgiglio at netmar dot com Reported By: jgiglio at smythco dot com Status: Bogus Bug...
    5. #24919 [NEW]: PHP File Uploads in RAM
      From: jgiglio at smythco dot com Operating system: Linux PHP version: Irrelevant PHP Bug Type: Feature/Change Request Bug...
  3. #2

    Default Re: PHP and file uploads

    "OneSolution" <onesolution@jatakainc.com> wrote in message
    news:IGiwb.171$q57.133805181@newssvr11.news.prodig y.com...
    > Hi All,
    >
    > Here's one thing that I don't know much about - file uploading. As part
    of
    > my project, I will have to build a file manager of sorts - perhaps a
    > document manager. Anyhow, this involves allowing my user to upload files
    to
    > a location.
    >
    > I know PHP can do it - I know this because it sure does everything else
    ....
    > but I don't know this from any authoritative source.
    >
    > So ... can you tell me if PHP can handle files uploads, and if so, what
    are
    > the drawbacks that you might have learned of in your experience? For
    > instance, in the ASP world, using a COM object for the upload works, but
    > apparently has significant impact on performance.
    >
    > So anyway, advise (advice???) me ...
    >
    > Thanks,
    > Santosh
    >
    >
    It's really easy, just use the right form field, and be sure to copy it to a
    location. Remember, it is a temp file until you copy it somewhere. This
    means it is gone once your script has finished.

    $filename=$HTTP_POST_FILES['file']['name'];
    $uploadedtempfile=$HTTP_POST_FILES['file']['tmp_name'];
    $newfilepath="WHATEVER";
    copy ($uploadedtempfile, $newfilepath);

    Regards
    Richard Grove

    [url]http://shopbuilder.org[/url] - ecommerce systems
    Become a Shop Builder re-seller:
    [url]http://www.affiliatewindow.com/affiliates/merchantdetails.php?mid=611[/url]
    [url]http://www.affiliatewindow.com/a.pl?590[/url]





    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    Version: 6.0.536 / Virus Database: 331 - Release Date: 03/11/2003


    Richard Grove Guest

  4. #3

    Default Re: PHP and file uploads

    "Richard Grove" <info[at]redeyemedia[dot]co[dot]uk> wrote in
    news:3fc1cb60$0$103$65c69314@mercury.nildram.net:
    > "OneSolution" <onesolution@jatakainc.com> wrote in message
    > news:IGiwb.171$q57.133805181@newssvr11.news.prodig y.com...
    >> Hi All,
    >>
    >> Here's one thing that I don't know much about - file uploading. As
    >> part
    > of
    >> my project, I will have to build a file manager of sorts - perhaps a
    >> document manager. Anyhow, this involves allowing my user to upload
    >> files
    > to
    >> a location.
    >>
    >> I know PHP can do it - I know this because it sure does everything
    >> else
    > ...
    >> but I don't know this from any authoritative source.
    >>
    >> So ... can you tell me if PHP can handle files uploads, and if so,
    >> what
    > are
    >> the drawbacks that you might have learned of in your experience? For
    >> instance, in the ASP world, using a COM object for the upload works,
    >> but apparently has significant impact on performance.
    >>
    >> So anyway, advise (advice???) me ...
    >>
    >> Thanks,
    >> Santosh
    >>
    >>
    >
    > It's really easy, just use the right form field, and be sure to copy
    > it to a location. Remember, it is a temp file until you copy it
    > somewhere. This means it is gone once your script has finished.
    >
    > $filename=$HTTP_POST_FILES['file']['name'];
    > $uploadedtempfile=$HTTP_POST_FILES['file']['tmp_name'];
    > $newfilepath="WHATEVER";
    > copy ($uploadedtempfile, $newfilepath);
    >
    > Regards
    > Richard Grove
    >
    > [url]http://shopbuilder.org[/url] - ecommerce systems
    > Become a Shop Builder re-seller:
    > [url]http://www.affiliatewindow.com/affiliates/merchantdetails.php?mid=611[/url]
    > [url]http://www.affiliatewindow.com/a.pl?590[/url]
    >
    >
    >
    >
    >
    > ---
    > Outgoing mail is certified Virus Free.
    > Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    > Version: 6.0.536 / Virus Database: 331 - Release Date: 03/11/2003
    >
    >
    >
    You could think about using PEAR http upload, which I found useful.

    VonHeler
    Von Heler Guest

  5. #4

    Default Re: PHP and file uploads

    Von Heler <vonheler@hotmail.com> wrote in
    news:Xns943D63D76C9C8vonvonde@130.133.1.4:
    > "Richard Grove" <info[at]redeyemedia[dot]co[dot]uk> wrote in
    > news:3fc1cb60$0$103$65c69314@mercury.nildram.net:
    >
    >> "OneSolution" <onesolution@jatakainc.com> wrote in message
    >> news:IGiwb.171$q57.133805181@newssvr11.news.prodig y.com...
    >>> Hi All,
    >>>
    >>> Here's one thing that I don't know much about - file uploading. As
    >>> part
    >> of
    >>> my project, I will have to build a file manager of sorts - perhaps a
    >>> document manager. Anyhow, this involves allowing my user to upload
    >>> files
    >> to
    >>> a location.
    >>>
    >>> I know PHP can do it - I know this because it sure does everything
    >>> else
    >> ...
    >>> but I don't know this from any authoritative source.
    >>>
    >>> So ... can you tell me if PHP can handle files uploads, and if so,
    >>> what
    >> are
    >>> the drawbacks that you might have learned of in your experience? For
    >>> instance, in the ASP world, using a COM object for the upload works,
    >>> but apparently has significant impact on performance.
    >>>
    >>> So anyway, advise (advice???) me ...
    >>>
    >>> Thanks,
    >>> Santosh
    >>>
    >>>
    >>
    >> It's really easy, just use the right form field, and be sure to copy
    >> it to a location. Remember, it is a temp file until you copy it
    >> somewhere. This means it is gone once your script has finished.
    >>
    >> $filename=$HTTP_POST_FILES['file']['name'];
    >> $uploadedtempfile=$HTTP_POST_FILES['file']['tmp_name'];
    >> $newfilepath="WHATEVER";
    >> copy ($uploadedtempfile, $newfilepath);
    >>
    >> Regards
    >> Richard Grove
    >>
    >> [url]http://shopbuilder.org[/url] - ecommerce systems
    >> Become a Shop Builder re-seller:
    >> [url]http://www.affiliatewindow.com/affiliates/merchantdetails.php?mid=611[/url]
    >> [url]http://www.affiliatewindow.com/a.pl?590[/url]
    >>
    >>
    >>
    >>
    >>
    >> ---
    >> Outgoing mail is certified Virus Free.
    >> Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    >> Version: 6.0.536 / Virus Database: 331 - Release Date: 03/11/2003
    >>
    >>
    >>
    >
    > You could think about using PEAR http upload, which I found useful.
    >
    > VonHeler
    >
    [url]http://pear.php.net/package/HTTP_Upload[/url]
    Von Heler Guest

  6. #5

    Default Re: PHP and file uploads

    On Mon, 24 Nov 2003 07:45:44 GMT, "OneSolution"
    <onesolution@jatakainc.com> wrote:
    >So ... can you tell me if PHP can handle files uploads, and if so, what are
    >the drawbacks that you might have learned of in your experience? For
    >instance, in the ASP world, using a COM object for the upload works, but
    >apparently has significant impact on performance.
    PHP does file uploads - but you need to check the server is configured
    to allow it easily. The upload methods built into the language can be
    turned off in the PHP configuration file on the server.

    If you are running in some kind of "safe" environment where the upload
    facility has been switched off, you can usually get around it by
    opening an FTP connection and sending the various FTP commands (which
    works really well actually).


    kafooey
    - [email]kafooey@nospam.yahoo.co.uk[/email]
    - [url]http://www.pluggedout.com/blog[/url]
    kafooey Guest

  7. #6

    Default Re: PHP and file uploads

    "OneSolution" <onesolution@jatakainc.com> wrote in message news:<IGiwb.171$q57.133805181@newssvr11.news.prodi gy.com>...
    > Hi All,
    >
    > Here's one thing that I don't know much about - file uploading. As part of
    > my project, I will have to build a file manager of sorts - perhaps a
    > document manager. Anyhow, this involves allowing my user to upload files to
    > a location.
    >
    > I know PHP can do it - I know this because it sure does everything else ...
    > but I don't know this from any authoritative source.
    >
    > So ... can you tell me if PHP can handle files uploads, and if so, what are
    > the drawbacks that you might have learned of in your experience? For
    > instance, in the ASP world, using a COM object for the upload works, but
    > apparently has significant impact on performance.
    >
    > So anyway, advise (advice???) me ...
    1. Use Google ( [url]http://www.google.com/search?q=file+upload+PHP[/url] )
    2. Use php.net (
    [url]http://www.google.com/search?q=file+upload+site%3Awww%2Ephp%2Enet[/url] )

    ---
    "Dying is an art, like everything else"---Sylvia Plath
    Email: rrjanbiah-at-Y!com
    R. Rajesh Jeba Anbiah Guest

  8. #7

    Default Re: PHP and file uploads

    Regarding this well-known quote, often attributed to OneSolution's famous
    "Mon, 24 Nov 2003 07:45:44 GMT" speech:
    > Hi All,
    >
    > Here's one thing that I don't know much about - file uploading. As part of
    > my project, I will have to build a file manager of sorts - perhaps a
    > document manager. Anyhow, this involves allowing my user to upload files to
    > a location.
    >
    > I know PHP can do it - I know this because it sure does everything else ...
    > but I don't know this from any authoritative source.
    >
    > So ... can you tell me if PHP can handle files uploads, and if so, what are
    > the drawbacks that you might have learned of in your experience? For
    > instance, in the ASP world, using a COM object for the upload works, but
    > apparently has significant impact on performance.
    >
    > So anyway, advise (advice???) me ...
    >
    > Thanks,
    > Santosh
    The only drawback of PHP uploading is that the entire file(s) needs to be
    uploaded before PHP processes, which rules out things like progress bars
    and stopping invalid uploads early.

    There's a PERL-to-PHP sort of snap-in for this that someone's made, but I
    don't recall the URL (anyone?).

    --
    -- Rudy Fleminger
    -- [email]sp@mmers.and.evil.ones.will.bow-down-to.us[/email]
    (put "Hey!" in the Subject line for priority processing!)
    -- [url]http://www.pixelsaredead.com[/url]
    FLEB Guest

  9. #8

    Default Re: PHP and file uploads

    FLEB <soon.the.sp@mmers.and.evil.ones.will.bow-down-to.us> wrote in message news:<1gzrnr9atpp9e$.1vgb810lp9j7h$.dlg@40tude.net >...
    > Regarding this well-known quote, often attributed to OneSolution's famous
    > "Mon, 24 Nov 2003 07:45:44 GMT" speech:
    >
    > > Hi All,
    > >
    > > Here's one thing that I don't know much about - file uploading. As part of
    > > my project, I will have to build a file manager of sorts - perhaps a
    > > document manager. Anyhow, this involves allowing my user to upload files to
    > > a location.
    > >
    > > I know PHP can do it - I know this because it sure does everything else ...
    > > but I don't know this from any authoritative source.
    > >
    > > So ... can you tell me if PHP can handle files uploads, and if so, what are
    > > the drawbacks that you might have learned of in your experience? For
    > > instance, in the ASP world, using a COM object for the upload works, but
    > > apparently has significant impact on performance.
    > >
    > > So anyway, advise (advice???) me ...
    > >
    > > Thanks,
    > > Santosh
    >
    > The only drawback of PHP uploading is that the entire file(s) needs to be
    > uploaded before PHP processes, which rules out things like progress bars
    > and stopping invalid uploads early.
    >
    > There's a PERL-to-PHP sort of snap-in for this that someone's made, but I
    > don't recall the URL (anyone?).
    [url]http://www.google.com/search?q=php+upload+progress[/url]

    ---
    "Dying is an art, like everything else"---Sylvia Plath
    Email: rrjanbiah-at-Y!com
    R. Rajesh Jeba Anbiah Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139