<input type="file"> change where file gets uploaded?

Discussion in 'HTML' started by Mark, Oct 18, 2006.

  1. Mark

    Mark Guest

    Hi,

    So, from my understanding, when you use <input type="file"> your file
    gets uploaded to some temporary folder...

    But is there a way to change where it gets uploaded?

    On my web server, all sites share the same temp folder..so I want to it
    to upload somewhere on *my* site.


    Thanks
    Mark, Oct 18, 2006
    #1
    1. Advertising

  2. Mark wrote:
    > So, from my understanding, when you use <input type="file"> your file
    > gets uploaded to some temporary folder...
    >
    > But is there a way to change where it gets uploaded?
    >
    > On my web server, all sites share the same temp folder..so I want to it
    > to upload somewhere on *my* site.


    That's a server-side issue. HTML doesn't know or care how your server
    processes uploaded data.

    Since you haven't told us what server-side technology is handling the
    upload, we can't tell you how to configure it.
    Leif K-Brooks, Oct 18, 2006
    #2
    1. Advertising

  3. Mark

    Mark Guest

    Leif K-Brooks wrote:
    > Mark wrote:
    > > So, from my understanding, when you use <input type="file"> your file
    > > gets uploaded to some temporary folder...
    > >
    > > But is there a way to change where it gets uploaded?
    > >
    > > On my web server, all sites share the same temp folder..so I want to it
    > > to upload somewhere on *my* site.

    >
    > That's a server-side issue. HTML doesn't know or care how your server
    > processes uploaded data.
    >
    > Since you haven't told us what server-side technology is handling the
    > upload, we can't tell you how to configure it.


    Ah... I was told I could do something like <input
    type="public_html/folder/file"> but... that didn't strike me as right.

    However, apparently it can be set in php.ini (since I am using php
    anyways...)
    Mark, Oct 18, 2006
    #3
  4. Mark wrote:

    >
    > Leif K-Brooks wrote:
    > > Mark wrote:
    > > > So, from my understanding, when you use <input type="file"> your
    > > > file gets uploaded to some temporary folder...
    > > >
    > > > But is there a way to change where it gets uploaded?
    > > >
    > > > On my web server, all sites share the same temp folder..so I want
    > > > to it to upload somewhere on my site.

    > >
    > > That's a server-side issue. HTML doesn't know or care how your
    > > server processes uploaded data.
    > >
    > > Since you haven't told us what server-side technology is handling
    > > the upload, we can't tell you how to configure it.

    >
    > Ah... I was told I could do something like <input
    > type="public_html/folder/file"> but... that didn't strike me as right.
    >
    > However, apparently it can be set in php.ini (since I am using php
    > anyways...)


    Since you're using PHP, check the manual:
    http://php.net/features.file-upload

    --
    Kim André Akerø
    -
    (remove NOSPAM to contact me directly)
    =?iso-8859-1?Q?Kim_Andr=E9_Aker=F8?=, Oct 18, 2006
    #4
  5. Mark

    jojo Guest

    Mark wrote:
    >>> So, from my understanding, when you use <input type="file"> your file
    >>> gets uploaded to some temporary folder...
    >>>
    >>> But is there a way to change where it gets uploaded?
    >>>
    >>> On my web server, all sites share the same temp folder..so I want to it
    >>> to upload somewhere on *my* site.

    >
    > However, apparently it can be set in php.ini (since I am using php
    > anyways...)


    If you have acces to it. But this isn't always the case. Some webhosters
    do not givew you acces to it because of security reasons. They perhaps
    block some PHP-functions which they consider to be a security problem
    and do not want them to get activated again (Just one example, there are
    a lot more).
    But a way that would always work is to copy the temporary file into your
    directory:

    copy ($_FILES['NAME_OF_YOUR_INPUT']['tmp_name'],
    "PATH_TO_YOUR_DIRECTORY".$_FILES['NAME_OF_YOUR_INPUT']['name']);

    HTH, jojo
    jojo, Oct 18, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt G
    Replies:
    1
    Views:
    1,135
    Deepak Kumar Vasudevan
    Aug 22, 2003
  2. Spotted Owl Eater

    Determine the File Type of an Uploaded File

    Spotted Owl Eater, Nov 16, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,839
    Patrice
    Nov 16, 2005
  3. Stefan Mueller
    Replies:
    5
    Views:
    499
    Steven Saunderson
    Jul 10, 2006
  4. Roberto
    Replies:
    3
    Views:
    291
  5. John Joyce

    gets gets

    John Joyce, Mar 26, 2007, in forum: Ruby
    Replies:
    2
    Views:
    325
    John Joyce
    Mar 26, 2007
Loading...

Share This Page