|
Need a form to specify "SaveFiles" directory
Last post 08-17-2012, 2:50 PM by mhpeters. 11 replies.
-
08-08-2012, 1:25 PM |
-
mhpeters
-
-
-
Joined on 08-08-2012
-
-
Posts 7
-
-
|
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 |
-
mhpeters
-
-
-
Joined on 08-08-2012
-
-
Posts 7
-
-
|
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 |
-
Kenneth
-
-
-
Joined on 02-13-2008
-
-
Posts 3,886
-
-
|
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 |
-
mhpeters
-
-
-
Joined on 08-08-2012
-
-
Posts 7
-
-
|
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 |
-
Kenneth
-
-
-
Joined on 02-13-2008
-
-
Posts 3,886
-
-
|
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 |
-
mhpeters
-
-
-
Joined on 08-08-2012
-
-
Posts 7
-
-
|
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.17System | 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
|
ConfigurationPHP CoreDirective | Local Value | Master Value |
---|
allow_call_time_pass_reference | Off | Off | allow_url_fopen | On | On | allow_url_include | On | On | always_populate_raw_post_data | Off | Off | arg_separator.input | & | & | arg_separator.output | & | & | asp_tags | Off | Off | auto_append_file | no value | no value | auto_globals_jit | On | On | auto_prepend_file | no value | no value | browscap | no value | no value | default_charset | no value | no value | default_mimetype | text/html | text/html | define_syslog_variables | Off | Off | disable_classes | no value | no value | disable_functions | no value | no value | display_errors | On | On | display_startup_errors | Off | Off | doc_root | no value | no value | docref_ext | no value | no value | docref_root | no value | no value | enable_dl | On | On | error_append_string | no value | no value | error_log | no value | no value | error_prepend_string | no value | no value | error_reporting | 6135 | 6135 | expose_php | Off | Off | extension_dir | c:\php5\ext | c:\php5\ext | file_uploads | On | On | 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_errors | On | On | ignore_repeated_errors | Off | Off | ignore_repeated_source | Off | Off | ignore_user_abort | Off | Off | implicit_flush | Off | Off | include_path | .;C:\php5\pear | .;C:\php5\pear | log_errors | Off | Off | log_errors_max_len | 1024 | 1024 | magic_quotes_gpc | On | On | magic_quotes_runtime | Off | Off | magic_quotes_sybase | Off | Off | mail.force_extra_parameters | no value | no value | max_execution_time | 30 | 30 | max_file_uploads | 20 | 20 | max_input_nesting_level | 64 | 64 | max_input_time | 60 | 60 | memory_limit | 264M | 264M | open_basedir | no value | no value | output_buffering | no value | no value | output_handler | no value | no value | post_max_size | 1536M | 1536M | precision | 14 | 14 | realpath_cache_size | 16K | 16K | realpath_cache_ttl | 120 | 120 | register_argc_argv | Off | Off | register_globals | Off | Off | register_long_arrays | Off | Off | report_memleaks | On | On | report_zend_debug | On | On | safe_mode | Off | Off | safe_mode_exec_dir | no value | no value | safe_mode_gid | Off | Off | safe_mode_include_dir | ~ | ~ | sendmail_from | me@localhost.com | me@localhost.com | sendmail_path | no value | no value | serialize_precision | 100 | 100 | short_open_tag | On | On | SMTP | relay-hosting.secureserver.net | relay-hosting.secureserver.net | smtp_port | 25 | 25 | sql.safe_mode | Off | Off | track_errors | Off | Off | unserialize_callback_func | no value | no value | upload_max_filesize | 1536M | 1536M | upload_tmp_dir | /tmp | /tmp | user_dir | no value | no value | variables_order | GPCS | GPCS | xmlrpc_error_number | 0 | 0 | xmlrpc_errors | Off | Off | y2k_compliance | On | On | zend.ze1_compatibility_mode | Off | Off |
Directive | Local Value | Master Value |
---|
cgi.check_shebang_line | 1 | 1 | cgi.fix_pathinfo | 0 | 0 | cgi.force_redirect | 1 | 1 | cgi.nph | 0 | 0 | cgi.redirect_status_env | no value | no value | cgi.rfc2616_headers | 0 | 0 | fastcgi.impersonate | 0 | 0 | fastcgi.logging | 1 | 1 |
COM support | enabled |
---|
DCOM support | disabled |
---|
.Net support | enabled |
---|
Directive | Local Value | Master Value |
---|
com.allow_dcom | 0 | 0 | com.autoregister_casesensitive | 1 | 1 | com.autoregister_typelib | 0 | 0 | com.autoregister_verbose | 0 | 0 | com.code_page | no value | no value | com.typelib_file | no value | no value |
cURL support | enabled | cURL Information | libcurl/7.21.0 OpenSSL/0.9.8q zlib/1.2.3 |
date/time support | enabled | "Olson" Timezone Database Version | 2010.9 | Timezone Database | internal | Default timezone | America/Phoenix |
Directive | Local Value | Master Value |
---|
date.default_latitude | 31.7667 | 31.7667 | date.default_longitude | 35.2333 | 35.2333 | date.sunrise_zenith | 90.583333 | 90.583333 | date.sunset_zenith | 90.583333 | 90.583333 | date.timezone | America/Phoenix | America/Phoenix |
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 |
Input Validation and Filtering | enabled | Revision | $Revision: 298196 $ |
Directive | Local Value | Master Value |
---|
filter.default | unsafe_raw | unsafe_raw | filter.default_flags | no value | no value |
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 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 support | enabled | iconv implementation | "libiconv" | iconv library version | 1.11 |
Directive | Local Value | Master Value |
---|
iconv.input_encoding | ISO-8859-1 | ISO-8859-1 | iconv.internal_encoding | ISO-8859-1 | ISO-8859-1 | iconv.output_encoding | ISO-8859-1 | ISO-8859-1 |
json support | enabled | json version | 1.2.1 |
libXML support | active | libXML Version | 2.7.7 | libXML streams | enabled |
MySQL Support | enabled |
---|
Active Persistent Links | 0 | Active Links | 0 | Client API version | 5.0.51a |
Directive | Local Value | Master Value |
---|
mysql.allow_persistent | On | On | mysql.connect_timeout | 30 | 30 | mysql.default_host | no value | no value | mysql.default_password | no value | no value | mysql.default_port | no value | no value | mysql.default_socket | no value | no value | mysql.default_user | no value | no value | mysql.max_links | Unlimited | Unlimited | mysql.max_persistent | Unlimited | Unlimited | mysql.trace_mode | Off | Off |
ODBC Support | enabled |
---|
Active Persistent Links | 0 | Active Links | 0 | ODBC library | Win32 |
Directive | Local Value | Master Value |
---|
odbc.allow_persistent | On | On | odbc.check_persistent | On | On | odbc.default_cursortype | Static cursor | Static cursor | odbc.default_db | no value | no value | odbc.default_pw | no value | no value | odbc.default_user | no value | no value | odbc.defaultbinmode | return as is | return as is | odbc.defaultlrl | return up to 4096 bytes | return up to 4096 bytes | odbc.max_links | Unlimited | Unlimited | odbc.max_persistent | Unlimited | Unlimited |
OpenSSL support | enabled | OpenSSL Version | OpenSSL 0.9.8q 2 Dec 2010 |
PCRE (Perl Compatible Regular BLOCKED EXPRESSION Support | enabled | PCRE Library Version | 8.02 2010-03-19 |
Directive | Local Value | Master Value |
---|
pcre.backtrack_limit | 100000 | 100000 | pcre.recursion_limit | 100000 | 100000 |
Reflection | enabled |
---|
Version | $Id: php_reflection.c 300129 2010-06-03 00:43:37Z felipe $ |
Session Support | enabled | Registered save handlers | files user | Registered serializer handlers | php php_binary wddx |
Directive | Local Value | Master Value |
---|
session.auto_start | Off | Off | session.bug_compat_42 | Off | Off | session.bug_compat_warn | On | On | session.cache_expire | 180 | 180 | session.cache_limiter | nocache | nocache | session.cookie_domain | no value | no value | session.cookie_httponly | Off | Off | session.cookie_lifetime | 0 | 0 | session.cookie_path | / | / | session.cookie_secure | Off | Off | session.entropy_file | no value | no value | session.entropy_length | 0 | 0 | session.gc_divisor | 100 | 100 | session.gc_maxlifetime | 1440 | 1440 | session.gc_probability | 1 | 1 | session.hash_bits_per_character | 5 | 5 | session.hash_function | 0 | 0 | session.name | PHPSESSID | PHPSESSID | session.referer_check | no value | no value | session.save_handler | files | files | session.save_path | no value | no value | session.serialize_handler | php | php | session.use_cookies | On | On | session.use_only_cookies | Off | Off | session.use_trans_sid | 0 | 0 |
Simplexml support | enabled |
---|
Revision | $Revision: 299016 $ | Schema support | enabled |
SPL support | enabled |
---|
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 |
Regex Library | Bundled library enabled | Dynamic Library Support | enabled | Internal Sendmail Support for Windows | enabled |
Directive | Local Value | Master Value |
---|
assert.active | 1 | 1 | assert.bail | 0 | 0 | assert.callback | no value | no value | assert.quiet_eval | 0 | 0 | assert.warning | 1 | 1 | auto_detect_line_endings | 0 | 0 | default_socket_timeout | 60 | 60 | safe_mode_allowed_env_vars | PHP_ LANG LANG_ | PHP_ LANG LANG_ | safe_mode_protected_env_vars | LD_LIBRARY_PATH | LD_LIBRARY_PATH | url_rewriter.tags | a=href,area=href,frame=src,input=src,form=,fieldset= | a=href,area=href,frame=src,input=src,form=,fieldset= | user_agent | no value | no value |
Tokenizer Support | enabled |
WDDX Support | enabled |
---|
WDDX Session Serializer | enabled |
XML Support | active | XML Namespace Support | active | libxml2 Version | 2.7.7 |
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 |
Directive | Local Value | Master Value |
---|
zlib.output_compression | Off | Off | zlib.output_compression_level | -1 | -1 | zlib.output_handler | no value | no value |
Additional ModulesEnvironmentVariable | Value |
---|
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 VariablesVariable | Value |
---|
_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 LicenseThis 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 |
-
Kenneth
-
-
-
Joined on 02-13-2008
-
-
Posts 3,886
-
-
|
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 |
-
mhpeters
-
-
-
Joined on 08-08-2012
-
-
Posts 7
-
-
|
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 |
-
Kenneth
-
-
-
Joined on 02-13-2008
-
-
Posts 3,886
-
-
|
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 |
-
mhpeters
-
-
-
Joined on 08-08-2012
-
-
Posts 7
-
-
|
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>
<?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 |
-
Kenneth
-
-
-
Joined on 02-13-2008
-
-
Posts 3,886
-
-
|
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 |
-
mhpeters
-
-
-
Joined on 08-08-2012
-
-
Posts 7
-
-
|
Re: Need a form to specify "SaveFiles" directory
Thanks Ken. It's working now. Thanks again for all of your support. Mike
|
|
|
|
|