Forum Moderators: coopster
The problem I am having is that is seems to work only 1/2 the time. Which is wierd, because you would think it would either work or not work.
I am trying to examine my code to see if I am properly setting the directory.
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.echo 'Upload result:<br>'; // At least one symbol should be sent to response!
$uploaddir = 'C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\xfer\\';
$uploadfile = $uploaddir . basename($_FILES['Filedata']['name']);echo '<pre>';
if (move_uploaded_file($_FILES['Filedata']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}echo 'Here is some more debugging info:';
print_r($_FILES);echo "</pre>";
?>
on the line where I have
$uploaddir = 'C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\xfer\\';
I am wondering if this is correct. There are many options that I am thinking could be the best, such as
$uploaddir = 'C:\\Program Files\Apache Software Foundation\Apache2.2\htdocs\xfer\\';
$uploaddir = 'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/xfer//';
$uploaddir = 'C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\xfer\';
$uploaddir = '../';
$uploaddir = '..//';
any ideas? thank you :)
upload_max_filesize and post_max_size?
<IfModule mod_php4.c>
php_value upload_max_filesize 50M
php_value post_max_size 50M
</IfModule>
- means 50MB upload limit.
Also, make sure that the setting for the post_max_size allows for a proper file size range.
post_max_size = 128M ; Expands the size of POST data for file uploads
Found on www.php.net
Michal
I have looked over the site on pear.php.net.
I have spent about an hour now and cannot make sense of anything. Could you please point me in the right direction.
for instance on their code it is calling for other .php files that dont exist and the instructions are in poor english.
take a look (using version 2.3)
starting at line 23 of Progress2.php
require_once 'HTML/Common.php';
require_once 'HTML/CSS.php';
require_once 'Event/Dispatcher.php';
yet when i unziped the package there were no folders for event or html. furthermore the files inside those folders dont exist anywhere else.
have you used this package? if so can you lend a helping hand?