Need a form to specify "SaveFiles" directory

Last post 08-17-2012, 2:50 PM by mhpeters. 11 replies.
Sort Posts: Previous Next
  •  08-08-2012, 1:25 PM 74377

    Need a form to specify "SaveFiles" directory

    I'm trying to build a form to use phpuloader but will allow the user to specify the directory where the files will be saved.  The actual form will be created with the following code:
     
    <?php
    //Step 1: Register Uploader component to your page
    require_once "./phpuploader/include_phpuploader.php"
    ?>
    <html>
    <body>
    <form id="form1" method="POST" action="uploadfiles.php">
    Upload Directory<input size=75 type=text name='pathname'>
    <?php  
                    //Step 2: Create Uploader object.  
                    $uploader=new PhpUploader();  
                    //Step 3: Set a unique name to Uploader  
                    $uploader->TempDirectory="tmp";
                    $uploader->Name="myuploader";   
                    //Step 4: Render Uploader  
                    $uploader->Render();  
    ?>
    </form>
    </body>
    </html>
     
    I'm assuming the routine "uploadfiles.php" will retreive the pathname via $_POST['pathname'] as is traditionally done with forms.
     
    Am I correct?
  •  08-08-2012, 1:38 PM 74378 in reply to 74377

    Re: Need a form to specify "SaveFiles" directory

    I had to add session_start() to the beginning to get past an error.  Now the form loads but when I select an image to loiad I get a small error dialog box with the message "SLM Error".
  •  08-09-2012, 10:04 AM 74390 in reply to 74378

    Re: Need a form to specify "SaveFiles" directory

    Hi mhpeters,
     
    Can you send me your uploader page url? So I can check it for you.
     
    Kenneth@CuteSoft.net 
     
    Regards,
     
    Ken 
  •  08-09-2012, 11:59 AM 74392 in reply to 74390

    Re: Need a form to specify "SaveFiles" directory

    My URL is:
     
     
    Note that I only get the "SLM error" from IE9.  With Firefox I'm getting the following:
     

    Server side exception, failed to upload _DSC3120 4X6.jpg

     

    Debug Information:

     

    move_uploaded_file() [<a href='function.move-uploaded-file'>function.move-uploaded-file</a>]: Unable to move 'D:\temp\TMP\phpD3D8.tmp' to 'tmp/uploading.93691270-73fb-e205-40c9-ef1ecb9144ef._DSC3120 4X6.jpg.resx' , failed to move D:\temp\TMP\phpD3D8.tmp to tmp/uploading.93691270-73fb-e205-40c9-ef1ecb9144ef._DSC3120 4X6.jpg.resx' , at D:\Hosting\3380894\html\private\mike\Test\phpuploader\include_phpuploader.php line 1211

  •  08-10-2012, 8:03 AM 74402 in reply to 74392

    Re: Need a form to specify "SaveFiles" directory

    HI mhpeters,

     
      1.    Please try set property “TempDirectory” for the uploader control. Create an folder under the root of your site and give the write/read permission to your site of this folder. Then change the location below to the path of this folder.
     

     $uploader->TempDirectory="D:/2005/phpuploader/mytemp/";

     
      2.    If step 1 does not work, then please use “echo phpinfo();” to output all php info on the example page. I will check it for you.

    Regards,

    Ken

  •  08-15-2012, 2:13 PM 74424 in reply to 74402

    Re: Need a form to specify "SaveFiles" directory

    I tried setting "TempDirectory":
     
                    $uploader->TempDirectory="D:/Hosting/3380894/html/tmp";
    The files upload, but I get the following error:
     
    Fatal error: Uncaught exception 'Exception' with message 'unlink(D:/Hosting/3380894/html/tmp/persisted.1bfd7edb-f708-4e61-8516-25bf4d323e3e._DSC3120 4X6.jpg.resx) [<a href='function.unlink'>function.unlink</a>]: No such file or directory , failed to delete D:/Hosting/3380894/html/tmp/persisted.1bfd7edb-f708-4e61-8516-25bf4d323e3e._DSC3120 4X6.jpg.resx' , at D:\Hosting\3380894\html\private\mike\Test\phpuploader\include_phpuploader.php line 1337' in D:\Hosting\3380894\html\private\mike\Test\phpuploader\include_phpuploader.php:218 Stack trace: #0 D:\Hosting\3380894\html\private\mike\Test\phpuploader\include_phpuploader.php(1337): PhpUploader_Delete('D:\Hosting\3380...', 1337, 'D:/Hosting/3380...') #1 D:\Hosting\3380894\html\private\mike\Test\uploader.php(48): PhpUploadFile->Delete() #2 {main} thrown in D:\Hosting\3380894\html\private\mike\Test\phpuploader\include_phpuploader.php on line 218
     
    Here's the output from phpinfo():

    PHP Version 5.2.17


    System Windows NT P3NW8SHSSL049 6.0 build 6002
    Build Date May 11 2011 13:05:29
    Configure Command cscript /nologo configure.js "--with-php-build=..\..\..\..\win32build" "--enable-object-out-dir=..\obj" "--with-extra-includes=C:\Program Files\Microsoft SDK\PlatformSDK" "--without-gd" "--disable-ipv6" "--enable-snapshot-build" "--disable-zts" "--disable-isapi" "--disable-nsapi" "--enable-debug-pack" "--with-snapshot-template=..\..\..\..\template" "--without-pi3web"
    Server API CGI/FastCGI
    Virtual Directory Support disabled
    Configuration File (php.ini) Path C:\Windows
    Loaded Configuration File D:\Hosting\3380894\html\php5.ini
    Scan this dir for additional .ini files (none)
    additional .ini files parsed (none)
    PHP API 20041225
    PHP Extension 20060613
    Zend Extension 220060519
    Debug Build no
    Thread Safety disabled
    Zend Memory Manager enabled
    IPv6 Support disabled
    Registered PHP Streams php, file, data, http, ftp, compress.zlib, https, ftps
    Registered Stream Socket Transports tcp, udp, ssl, sslv3, sslv2, tls
    Registered Stream Filters convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, zlib.*

    This program makes use of the Zend Scripting Language Engine:
    Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies


    Configuration

    PHP Core

    DirectiveLocal ValueMaster Value
    allow_call_time_pass_referenceOffOff
    allow_url_fopenOnOn
    allow_url_includeOnOn
    always_populate_raw_post_dataOffOff
    arg_separator.input&&
    arg_separator.output&&
    asp_tagsOffOff
    auto_append_fileno valueno value
    auto_globals_jitOnOn
    auto_prepend_fileno valueno value
    browscapno valueno value
    default_charsetno valueno value
    default_mimetypetext/htmltext/html
    define_syslog_variablesOffOff
    disable_classesno valueno value
    disable_functionsno valueno value
    display_errorsOnOn
    display_startup_errorsOffOff
    doc_rootno valueno value
    docref_extno valueno value
    docref_rootno valueno value
    enable_dlOnOn
    error_append_stringno valueno value
    error_logno valueno value
    error_prepend_stringno valueno value
    error_reporting61356135
    expose_phpOffOff
    extension_dirc:\php5\extc:\php5\ext
    file_uploadsOnOn
    highlight.bg#FFFFFF#FFFFFF
    highlight.comment#FF8000#FF8000
    highlight.default#0000BB#0000BB
    highlight.html#000000#000000
    highlight.keyword#007700#007700
    highlight.string#DD0000#DD0000
    html_errorsOnOn
    ignore_repeated_errorsOffOff
    ignore_repeated_sourceOffOff
    ignore_user_abortOffOff
    implicit_flushOffOff
    include_path.;C:\php5\pear.;C:\php5\pear
    log_errorsOffOff
    log_errors_max_len10241024
    magic_quotes_gpcOnOn
    magic_quotes_runtimeOffOff
    magic_quotes_sybaseOffOff
    mail.force_extra_parametersno valueno value
    max_execution_time3030
    max_file_uploads2020
    max_input_nesting_level6464
    max_input_time6060
    memory_limit264M264M
    open_basedirno valueno value
    output_bufferingno valueno value
    output_handlerno valueno value
    post_max_size1536M1536M
    precision1414
    realpath_cache_size16K16K
    realpath_cache_ttl120120
    register_argc_argvOffOff
    register_globalsOffOff
    register_long_arraysOffOff
    report_memleaksOnOn
    report_zend_debugOnOn
    safe_modeOffOff
    safe_mode_exec_dirno valueno value
    safe_mode_gidOffOff
    safe_mode_include_dir~~
    sendmail_fromme@localhost.comme@localhost.com
    sendmail_pathno valueno value
    serialize_precision100100
    short_open_tagOnOn
    SMTPrelay-hosting.secureserver.netrelay-hosting.secureserver.net
    smtp_port2525
    sql.safe_modeOffOff
    track_errorsOffOff
    unserialize_callback_funcno valueno value
    upload_max_filesize1536M1536M
    upload_tmp_dir/tmp/tmp
    user_dirno valueno value
    variables_orderGPCSGPCS
    xmlrpc_error_number00
    xmlrpc_errorsOffOff
    y2k_complianceOnOn
    zend.ze1_compatibility_modeOffOff

    bcmath

    BCMath support enabled

    calendar

    Calendar support enabled

    cgi-fcgi

    DirectiveLocal ValueMaster Value
    cgi.check_shebang_line11
    cgi.fix_pathinfo00
    cgi.force_redirect11
    cgi.nph00
    cgi.redirect_status_envno valueno value
    cgi.rfc2616_headers00
    fastcgi.impersonate00
    fastcgi.logging11

    com_dotnet

    COM supportenabled
    DCOM supportdisabled
    .Net supportenabled

    DirectiveLocal ValueMaster Value
    com.allow_dcom00
    com.autoregister_casesensitive11
    com.autoregister_typelib00
    com.autoregister_verbose00
    com.code_pageno valueno value
    com.typelib_fileno valueno value

    ctype

    ctype functions enabled

    curl

    cURL support enabled
    cURL Information libcurl/7.21.0 OpenSSL/0.9.8q zlib/1.2.3

    date

    date/time support enabled
    "Olson" Timezone Database Version 2010.9
    Timezone Database internal
    Default timezone America/Phoenix

    DirectiveLocal ValueMaster Value
    date.default_latitude31.766731.7667
    date.default_longitude35.233335.2333
    date.sunrise_zenith90.58333390.583333
    date.sunset_zenith90.58333390.583333
    date.timezoneAmerica/PhoenixAmerica/Phoenix

    dom

    DOM/XML enabled
    DOM/XML API Version 20031129
    libxml Version 2.7.7
    HTML Support enabled
    XPath Support enabled
    XPointer Support enabled
    Schema Support enabled
    RelaxNG Support enabled

    filter

    Input Validation and Filtering enabled
    Revision $Revision: 298196 $

    DirectiveLocal ValueMaster Value
    filter.defaultunsafe_rawunsafe_raw
    filter.default_flagsno valueno value

    ftp

    FTP support enabled

    gd

    GD Support enabled
    GD Version bundled (2.0.34 compatible)
    FreeType Support enabled
    FreeType Linkage with freetype
    FreeType Version 2.1.9
    T1Lib Support enabled
    GIF Read Support enabled
    GIF Create Support enabled
    JPG Support enabled
    PNG Support enabled
    WBMP Support enabled
    XBM Support enabled

    hash

    hash support enabled
    Hashing Engines md2 md4 md5 sha1 sha256 sha384 sha512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru gost adler32 crc32 crc32b haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5

    iconv

    iconv support enabled
    iconv implementation "libiconv"
    iconv library version 1.11

    DirectiveLocal ValueMaster Value
    iconv.input_encodingISO-8859-1ISO-8859-1
    iconv.internal_encodingISO-8859-1ISO-8859-1
    iconv.output_encodingISO-8859-1ISO-8859-1

    json

    json support enabled
    json version 1.2.1

    libxml

    libXML support active
    libXML Version 2.7.7
    libXML streams enabled

    mysql

    MySQL Supportenabled
    Active Persistent Links 0
    Active Links 0
    Client API version 5.0.51a

    DirectiveLocal ValueMaster Value
    mysql.allow_persistentOnOn
    mysql.connect_timeout3030
    mysql.default_hostno valueno value
    mysql.default_passwordno valueno value
    mysql.default_portno valueno value
    mysql.default_socketno valueno value
    mysql.default_userno valueno value
    mysql.max_linksUnlimitedUnlimited
    mysql.max_persistentUnlimitedUnlimited
    mysql.trace_modeOffOff

    odbc

    ODBC Supportenabled
    Active Persistent Links 0
    Active Links 0
    ODBC library Win32

    DirectiveLocal ValueMaster Value
    odbc.allow_persistentOnOn
    odbc.check_persistentOnOn
    odbc.default_cursortypeStatic cursorStatic cursor
    odbc.default_dbno valueno value
    odbc.default_pwno valueno value
    odbc.default_userno valueno value
    odbc.defaultbinmodereturn as isreturn as is
    odbc.defaultlrlreturn up to 4096 bytesreturn up to 4096 bytes
    odbc.max_linksUnlimitedUnlimited
    odbc.max_persistentUnlimitedUnlimited

    openssl

    OpenSSL support enabled
    OpenSSL Version OpenSSL 0.9.8q 2 Dec 2010

    pcre

    PCRE (Perl Compatible Regular BLOCKED EXPRESSION Support enabled
    PCRE Library Version 8.02 2010-03-19

    DirectiveLocal ValueMaster Value
    pcre.backtrack_limit100000100000
    pcre.recursion_limit100000100000

    Reflection

    Reflectionenabled
    Version $Id: php_reflection.c 300129 2010-06-03 00:43:37Z felipe $

    session

    Session Support enabled
    Registered save handlers files user
    Registered serializer handlers php php_binary wddx

    DirectiveLocal ValueMaster Value
    session.auto_startOffOff
    session.bug_compat_42OffOff
    session.bug_compat_warnOnOn
    session.cache_expire180180
    session.cache_limiternocachenocache
    session.cookie_domainno valueno value
    session.cookie_httponlyOffOff
    session.cookie_lifetime00
    session.cookie_path//
    session.cookie_secureOffOff
    session.entropy_fileno valueno value
    session.entropy_length00
    session.gc_divisor100100
    session.gc_maxlifetime14401440
    session.gc_probability11
    session.hash_bits_per_character55
    session.hash_function00
    session.namePHPSESSIDPHPSESSID
    session.referer_checkno valueno value
    session.save_handlerfilesfiles
    session.save_pathno valueno value
    session.serialize_handlerphpphp
    session.use_cookiesOnOn
    session.use_only_cookiesOffOff
    session.use_trans_sid00

    SimpleXML

    Simplexml supportenabled
    Revision $Revision: 299016 $
    Schema support enabled

    SPL

    SPL supportenabled
    Interfaces Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject
    Classes AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, DirectoryIterator, DomainException, EmptyIterator, FilterIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RegexIterator, RuntimeException, SimpleXMLIterator, SplFileInfo, SplFileObject, SplObjectStorage, SplTempFileObject, UnderflowException, UnexpectedValueException

    standard

    Regex Library Bundled library enabled
    Dynamic Library Support enabled
    Internal Sendmail Support for Windows enabled

    DirectiveLocal ValueMaster Value
    assert.active11
    assert.bail00
    assert.callbackno valueno value
    assert.quiet_eval00
    assert.warning11
    auto_detect_line_endings00
    default_socket_timeout6060
    safe_mode_allowed_env_varsPHP_ LANG LANG_PHP_ LANG LANG_
    safe_mode_protected_env_varsLD_LIBRARY_PATHLD_LIBRARY_PATH
    url_rewriter.tagsa=href,area=href,frame=src,input=src,form=,fieldset=a=href,area=href,frame=src,input=src,form=,fieldset=
    user_agentno valueno value

    tokenizer

    Tokenizer Support enabled

    wddx

    WDDX Supportenabled
    WDDX Session Serializer enabled

    xml

    XML Support active
    XML Namespace Support active
    libxml2 Version 2.7.7

    xmlreader

    XMLReader enabled

    xmlwriter

    XMLWriter enabled

    zlib

    ZLib Support enabled
    Stream Wrapper support compress.zlib://
    Stream Filter support zlib.inflate, zlib.deflate
    Compiled Version 1.2.3
    Linked Version 1.2.3

    DirectiveLocal ValueMaster Value
    zlib.output_compressionOffOff
    zlib.output_compression_level-1-1
    zlib.output_handlerno valueno value

    Additional Modules

    Module Name

    Environment

    VariableValue
    PHPRC D:\Hosting\3380894\html\php5.ini
    ADDITIONALSERVERS p3nw5nlmaster01,p3nw5nlmedia01,p3nw5nlmedia02,p3pwarmedia01,p3media02
    ALLUSERSPROFILE C:\ProgramData
    APPDATA C:\Windows\system32\config\systemprofile\AppData\Roaming
    APP_POOL_ID 3380894_32_C_solo_v2.0
    CommonProgramFiles C:\Program Files (x86)\Common Files
    CommonProgramFiles(x86) C:\Program Files (x86)\Common Files
    CommonProgramW6432 C:\Program Files\Common Files
    COMPUTERNAME P3NW8SHSSL049
    ComSpec C:\Windows\system32\cmd.exe
    DEFGATE 184.168.192.254
    FP_NO_HOST_CHECK NO
    FQDN p3nw8shssl049.shr.prod.phx3.secureserver.net
    LOCALAPPDATA C:\Windows\system32\config\systemprofile\AppData\Local
    LOCALSQLMSTR %SQLMSTR%
    MASTERSERVER p3nw5nlmaster01
    NUMBER_OF_PROCESSORS 8
    OS Windows_NT
    Path C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Imaging\;D:\Program Files\Dell\OpenManage\oma\bin;C:\GDcomponents\tools
    PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    PRIMARYDNS 72.167.234.71
    PRIMARYIP 184.168.192.104
    PROCESSOR_ARCHITECTURE x86
    PROCESSOR_ARCHITEW6432 AMD64
    PROCESSOR_IDENTIFIER Intel64 Family 6 Model 44 Stepping 2, GenuineIntel
    PROCESSOR_LEVEL 6
    PROCESSOR_REVISION 2c02
    ProgramData C:\ProgramData
    ProgramFiles C:\Program Files (x86)
    ProgramFiles(x86) C:\Program Files (x86)
    ProgramW6432 C:\Program Files
    PSModulePath C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
    PUBLIC C:\Users\Public
    SECONDARYDNS 72.167.234.72
    SUBMASK 255.255.255.0
    SystemDrive C:
    SystemRoot C:\Windows
    TEMP d:\temp\tmp
    TMP d:\temp\tmp
    UATDATA C:\Windows\SysWOW64\CCM\UATData\D9F8C395-CAB8-491d-B8AC-179A1FE1BE77
    USERDOMAIN PHX3
    USERNAME P3NW8SHSSL049$
    USERPROFILE C:\Windows\system32\config\systemprofile
    windir C:\Windows

    PHP Variables

    VariableValue
    _REQUEST["PHPSESSID"]ej5bbgr1tug2o7fqv8nrm2osa0
    _COOKIE["PHPSESSID"]ej5bbgr1tug2o7fqv8nrm2osa0
    _SERVER["PHPRC"]D:\Hosting\3380894\html\php5.ini
    _SERVER["ADDITIONALSERVERS"]p3nw5nlmaster01,p3nw5nlmedia01,p3nw5nlmedia02,p3pwarmedia01,p3media02
    _SERVER["ALLUSERSPROFILE"]C:\ProgramData
    _SERVER["APPDATA"]C:\Windows\system32\config\systemprofile\AppData\Roaming
    _SERVER["APP_POOL_ID"]3380894_32_C_solo_v2.0
    _SERVER["CommonProgramFiles"]C:\Program Files (x86)\Common Files
    _SERVER["CommonProgramFiles(x86)"]C:\Program Files (x86)\Common Files
    _SERVER["CommonProgramW6432"]C:\Program Files\Common Files
    _SERVER["COMPUTERNAME"]P3NW8SHSSL049
    _SERVER["ComSpec"]C:\Windows\system32\cmd.exe
    _SERVER["DEFGATE"]184.168.192.254
    _SERVER["FP_NO_HOST_CHECK"]NO
    _SERVER["FQDN"]p3nw8shssl049.shr.prod.phx3.secureserver.net
    _SERVER["LOCALAPPDATA"]C:\Windows\system32\config\systemprofile\AppData\Local
    _SERVER["LOCALSQLMSTR"]%SQLMSTR%
    _SERVER["MASTERSERVER"]p3nw5nlmaster01
    _SERVER["NUMBER_OF_PROCESSORS"]8
    _SERVER["OS"]Windows_NT
    _SERVER["Path"]C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Imaging\;D:\Program Files\Dell\OpenManage\oma\bin;C:\GDcomponents\tools
    _SERVER["PATHEXT"].COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    _SERVER["PRIMARYDNS"]72.167.234.71
    _SERVER["PRIMARYIP"]184.168.192.104
    _SERVER["PROCESSOR_ARCHITECTURE"]x86
    _SERVER["PROCESSOR_ARCHITEW6432"]AMD64
    _SERVER["PROCESSOR_IDENTIFIER"]Intel64 Family 6 Model 44 Stepping 2, GenuineIntel
    _SERVER["PROCESSOR_LEVEL"]6
    _SERVER["PROCESSOR_REVISION"]2c02
    _SERVER["ProgramData"]C:\ProgramData
    _SERVER["ProgramFiles"]C:\Program Files (x86)
    _SERVER["ProgramFiles(x86)"]C:\Program Files (x86)
    _SERVER["ProgramW6432"]C:\Program Files
    _SERVER["PSModulePath"]C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
    _SERVER["PUBLIC"]C:\Users\Public
    _SERVER["SECONDARYDNS"]72.167.234.72
    _SERVER["SUBMASK"]255.255.255.0
    _SERVER["SystemDrive"]C:
    _SERVER["SystemRoot"]C:\Windows
    _SERVER["TEMP"]d:\temp\tmp
    _SERVER["TMP"]d:\temp\tmp
    _SERVER["UATDATA"]C:\Windows\SysWOW64\CCM\UATData\D9F8C395-CAB8-491d-B8AC-179A1FE1BE77
    _SERVER["USERDOMAIN"]PHX3
    _SERVER["USERNAME"]P3NW8SHSSL049$
    _SERVER["USERPROFILE"]C:\Windows\system32\config\systemprofile
    _SERVER["windir"]C:\Windows
    _SERVER["FCGI_ROLE"]RESPONDER
    _SERVER["HTTP_CONNECTION"]Keep-Alive
    _SERVER["HTTP_ACCEPT"]text/html, application/xhtml+xml, */*
    _SERVER["HTTP_ACCEPT_ENCODING"]gzip, deflate
    _SERVER["HTTP_ACCEPT_LANGUAGE"]en-US
    _SERVER["HTTP_COOKIE"]PHPSESSID=ej5bbgr1tug2o7fqv8nrm2osa0
    _SERVER["HTTP_HOST"]www.photographsbymike.com
    _SERVER["HTTP_USER_AGENT"]Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
    _SERVER["DOCUMENT_ROOT"]D:\Hosting\3380894\html
    _SERVER["REQUEST_URI"]/phpinfo.php
    _SERVER["SCRIPT_FILENAME"]D:\Hosting\3380894\html\phpinfo.php
    _SERVER["IIS_UrlRewriteModule"]1
    _SERVER["APPL_MD_PATH"]/LM/W3SVC/3380894/ROOT
    _SERVER["APPL_PHYSICAL_PATH"]D:\Hosting\3380894\html\
    _SERVER["AUTH_TYPE"]no value
    _SERVER["AUTH_PASSWORD"]no value
    _SERVER["AUTH_USER"]no value
    _SERVER["CERT_COOKIE"]no value
    _SERVER["CERT_FLAGS"]no value
    _SERVER["CERT_ISSUER"]no value
    _SERVER["CERT_SERIALNUMBER"]no value
    _SERVER["CERT_SUBJECT"]no value
    _SERVER["CONTENT_LENGTH"]0
    _SERVER["CONTENT_TYPE"]no value
    _SERVER["GATEWAY_INTERFACE"]CGI/1.1
    _SERVER["HTTPS"]off
    _SERVER["HTTPS_KEYSIZE"]no value
    _SERVER["HTTPS_SECRETKEYSIZE"]no value
    _SERVER["HTTPS_SERVER_ISSUER"]no value
    _SERVER["HTTPS_SERVER_SUBJECT"]no value
    _SERVER["INSTANCE_ID"]3380894
    _SERVER["INSTANCE_META_PATH"]/LM/W3SVC/3380894
    _SERVER["LOCAL_ADDR"]50.63.250.7
    _SERVER["LOGON_USER"]no value
    _SERVER["PATH_TRANSLATED"]D:\Hosting\3380894\html\phpinfo.php
    _SERVER["QUERY_STRING"]no value
    _SERVER["REMOTE_ADDR"]71.39.73.41
    _SERVER["REMOTE_HOST"]71.39.73.41
    _SERVER["REMOTE_PORT"]35061
    _SERVER["REMOTE_USER"]no value
    _SERVER["REQUEST_METHOD"]GET
    _SERVER["SCRIPT_NAME"]/phpinfo.php
    _SERVER["SERVER_NAME"]www.photographsbymike.com
    _SERVER["SERVER_PORT"]80
    _SERVER["SERVER_PORT_SECURE"]0
    _SERVER["SERVER_PROTOCOL"]HTTP/1.1
    _SERVER["SERVER_SOFTWARE"]Microsoft-IIS/7.0
    _SERVER["URL"]/phpinfo.php
    _SERVER["ORIG_PATH_INFO"]/phpinfo.php
    _SERVER["PHP_SELF"]/phpinfo.php
    _SERVER["REQUEST_TIME"]1345057696

    PHP License

    This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE

    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.

  •  08-16-2012, 8:36 AM 74438 in reply to 74424

    Re: Need a form to specify "SaveFiles" directory

    Hi mhpeters,
     
    It is a permission problem. I think you are using the "CoyTo" or "MoveTo" method on the page. And your site has not the write/read permission of the folder of you set for these methods. So the control can not move the file in it. Can you check the permission of it? And can you show me the full code of page https://www.photographsbymike.com/private/mike/test/uploader.php?
     
    Regards,
     
    Ken 
  •  08-16-2012, 11:17 AM 74442 in reply to 74438

    Re: Need a form to specify "SaveFiles" directory

    Here's the code:
     

    <?php require_once "./phpuploader/include_phpuploader.php" ?>
    <?php session_start(); ?>
    <?php
    if (!is_dir)
     mkdir ("D:/Hosting/3380894/html/tmp", 0777);
    else
     chmod("D:/Hosting/3380894/html/tmp", 0777);
    ?>
    <html>
    <body>
    <form id="form1" method="POST">
    Upload Directory<input size=75 type=text name='pathname'>
    <?php  
                    //Step 2: Create Uploader object.  
                    $uploader=new PhpUploader();  
                    //Step 3: Set a unique name to Uploader  
                    $uploader->TempDirectory="D:/Hosting/3380894/html/tmp";
        $uploader->MaxSizeKB=1024000; 
        $uploader->Name="myuploader";   
                    //Step 4: Render Uploader  
                    $uploader->Render();  
    ?>
    </form>
    <?php  
    //Gets the GUID of the file based on uploader name  
    $fileguid=@$_POST["myuploader"];  
    $pathname=$_POST["pathname"];  
    if($fileguid)  
    {  
        //get the uploaded file based on GUID  
        $mvcfile=$uploader->GetUploadedFile($fileguid);  
        if($mvcfile)  
        {  
            //Gets the name of the file.  
            echo($mvcfile->FileName."<br/>");  
            //Gets the temp file path.  
            echo($mvcfile->FilePath."<br/>");  
            //Gets the size of the file.  
            echo($mvcfile->FileSize."<br/>");   
              
            echo($pathname."<br/>");   

            //Copys the uploaded file to a new location.  
    //        $mvcfile->CopyTo("/uploads");  
            //Moves the uploaded file to a new location.  
            $mvcfile->MoveTo("D:/Hosting/3380894/html".$pathname);  
            //Deletes this instance.  
            $mvcfile->Delete();  
        }  

    //echo phpinfo();
    ?> 
    </body>
    </html>

  •  08-17-2012, 9:24 AM 74448 in reply to 74442

    Re: Need a form to specify "SaveFiles" directory

    Hi mhpeters,
     
    I know what is the problem now.
     
    When you use method "MoveTo", it will delete the temp file from the temp folder, and you have the "Delete" method after it, this is why get this problem. So just need to delete code $mvcfile->Delete();, it will work
     
    $mvcfile->MoveTo("D:/Hosting/3380894/html".$pathname);   
    $mvcfile->Delete();   
     
    Regards,
     
    Ken 
     
     
  •  08-17-2012, 11:34 AM 74449 in reply to 74448

    Re: Need a form to specify "SaveFiles" directory

    Ken, you were right.  Silly error on my part.  Thanks for the great support on this product.
     
    I moved the file handling code into a seperate method away from the form and now I'm getting a new error "Fatal error: Call to a member function GetUploadedFile() on a non-object in D:\Hosting\3380894\html\private\mike\Test\uploadfiles.php on line 17".
     
    I'm sure I'm doing something stupid again, but I can't find it.  I've included listings of both methods below.  Thanks again.  I'll be purchasing as soon as I can get this working.
     
    upload.php
     
    <?php require_once "./phpuploader/include_phpuploader.php" ?>
    <?php session_start(); ?>
    <?php
    if (!is_dir)
     mkdir ("D:/Hosting/3380894/html/tmp", 0777);
    else
     chmod("D:/Hosting/3380894/html/tmp", 0777);
    ?>
    <html>
    <body>
    <form id="form1" method="POST" action="uploadfiles.php">
    Upload Directory<input size=75 type=text name='pathname'>
    <?php  
                    //Step 2: Create Uploader object.  
                    $uploader=new PhpUploader();  
                    //Step 3: Set a unique name to Uploader  
                    $uploader->TempDirectory="D:/Hosting/3380894/html/tmp";
        $uploader->MaxSizeKB=1024000; 
        $uploader->Name="myuploader";   
                    //Step 4: Render Uploader  
                    $uploader->Render();  
    ?> 
    </form>
    </body>
    </html>
     
    uploadfiles.php
     

    <?php
    //Step 1: Register Uploader component to your page  
    require_once "./phpuploader/include_phpuploader.php";
    session_start();
    ?>  
    <html>  
    <body>  
    <?php  
    //Gets the GUID of the file based on uploader name  
    $fileguid=$_POST["myuploader"];  
    $pathname=$_POST["pathname"];  
    if($fileguid)  
    {  
     echo $fileguid;
     
        //get the uploaded file based on GUID  
        $mvcfile=$uploader->GetUploadedFile($fileguid);  
        if($mvcfile)  
        {  
            //Gets the name of the file.  
            //echo($mvcfile->FileName."<br/>");  
            //Gets the temp file path.  
            //echo($mvcfile->FilePath."<br/>");  
            //Gets the size of the file.  
            //echo($mvcfile->FileSize."<br/>");   
     
            //echo($pathname."<br/>");   

            //Copys the uploaded file to a new location.  
    //        $mvcfile->CopyTo("/uploads");  
            //Moves the uploaded file to a new location.  
            $mvcfile->MoveTo("D:/Hosting/3380894/html".$pathname);  
            //Deletes this instance.  
    //        $mvcfile->Delete();  
        }  
    }  
    ?> 
    </body>  
    </html> 

     
     
     
     
     
     
     
     
     
     
     
     
     
     
  •  08-17-2012, 1:55 PM 74451 in reply to 74449

    Re: Need a form to specify "SaveFiles" directory

    Hi mhpeters,
     
    In the upload handler file, you need to create the uploader instance too. 
     
    Please refer to "phpuploader\ajaxuploaderhandler.php", "ajax-attachments-handler.php" and "ajax-multiplefiles-handler.php"
     
    $uploader=new PhpUploader(); 
     
    Regards,
     
    Ken 
  •  08-17-2012, 2:50 PM 74452 in reply to 74451

    Re: Need a form to specify "SaveFiles" directory

    Thanks Ken.  It's working now.  Thanks again for all of your support.
     
    Mike
View as RSS news feed in XML