I tried using php to upload files but something about open_basdir would not let it. So I used FTP with php and the file uploaded fine. But the permsiisons changed and now I cannot access the dir (550). Can you see why this code would have changed permissions?? Here is the code.
<?php
$page_title = 'Upload a File';
if (isset($_POST['submit']))
{
require("config file with passwords");
// Create the file name.
$file = $_POST['upload'];
$extension = explode ('.', $_FILES['upload']['name']);
$uid = "19"; // Upload ID
$filename = $uid . '.' . $extension[1];
// Move the file over.
// set up basic connection
$conn_id = ftp_connect($ftp_host);
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user, $ftp_pwd);
// upload a file
ftp_chdir($conn_id, "classified/images");
if (ftp_put($conn_id, $filename, $file, FTP_ASCII))
{
echo "successfully uploaded $file\n";
}
else
{
echo "There was a problem while uploading $file\n";
}
// close the connection
ftp_close($conn_id);
}
?>
<form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="100">
<fieldset><legend>Fill out the form to upload a file:</legend>
<p><b>File:</b> <input type="file" name="upload" /></p>
<p><b>Description:</b> <textarea name="description" cols="40" rows="5"></textarea></p>
</fieldset>
<div align="center"><input type="submit" name="submit" value="Submit" /></div>
</form><!-- End of Form -->
Thanks