SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot shoorace's Avatar
    Join Date
    Jun 2005
    Location
    Florida
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Windows server - File upload error unable to create a temporary file

    Hi,
    My server is windows server 2000.
    I have given absolute path for file upload, and set the ini 's upload_tmp_dir as below:

    Code PHP:
    //ini_set ("upload_tmp_dir", "F:\******\upload\"); //tried already
    //ini_set ("upload_tmp_dir", "F:\\******\\upload\\"); //tried already
    //ini_set ("upload_tmp_dir", "F:\******\upload"); //tried already
    //ini_set ("upload_tmp_dir", "F:\\******\\upload"); //tried already
    ini_set ("upload_tmp_dir", "F:/******/upload/");


    But I am getting the error,

    PHP Warning: File upload error - unable to create a temporary file in Unknown on line 0
    The thing is unable to find the temp folder path for file uploads.

    I know that, folder permission is neednot be given in window server.

    So, what may be the solution?
    Thanks

  2. #2
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey PHP will not create folder for you itself. So you need to create yourself and set the path.

    Read this article:
    The Windows installer designates C:\Documents and Settings\<username>\Local Settings\Temp\php\upload as the value for upload_tmp_dir and C:\Documents and Settings\<username>\Local Settings\Temp\php\session as session.save_path. However, the installer doesn't create the necessary folders. Consequently, file uploads and sessions won't work until the folders are created. (In Windows Vista, the folders are C:\Users\<username>\AppData\Local\Temp\PHP\upload and C:\Users\<username>\AppData\Local\Temp\PHP\sessions.)

    Either open php.ini and rename the current folders to C:\WINDOWS\Temp, or create the necessary folders in C:\Documents and Settings\<username>\Local Settings\Temp (or the Vista equivalent). If you choose the option of renaming the folders, make sure you change the right settings in php.ini. The installer leaves the original commands unchanged and inserts new ones. The original commands have a semicolon at the beginning of the line, so are ignored.

    Remember to restart your web server after making any changes to php.ini.
    Edit:
    See the following links for more details that i had found before.
    http://forums.kayako.com/showthread.php?t=4067
    http://foundationphp.com/tutorials/php_installer.php

    These may help you.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  3. #3
    Serial Entrepreneur
    Join Date
    Jul 2007
    Location
    Atlanta, GA
    Posts
    495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And folder permissions do indeed need to be given to the temp directory so that the web server service program can create files in the directory.
    FreelanceLocalTech - FREE Freelance Consultant Directory!
    VersaReports Universal Report Server for .Net - Try It Now!

  4. #4
    SitePoint Member
    Join Date
    Dec 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    setting "upload_tmp_dir" to "C:\WINNT\Temp" actually did worked

    Thanks rajug


    the actual problem was there was no temporary folder created for php files
    it was set to "\tmp" but not created so

    any way i found my way out

    THANKS AGAIN

  5. #5
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by gauchani View Post
    setting "upload_tmp_dir" to "C:\WINNT\Temp" actually did worked

    Thanks rajug


    the actual problem was there was no temporary folder created for php files
    it was set to "\tmp" but not created so

    any way i found my way out

    THANKS AGAIN
    Welcome gauchani to sitepoint forums!

    Good to know that you solved the problem. Good luck!
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5


Bookmarks

Posting Permissions

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