Hi Marcell,
The first thing I'd like to do is point out that I am not an expert on servers so what follows is a little bit of stab in the dark. I just hope it is at least on the right lines.
The question you pose actually has some pretty blurred boundaries in that it encompasses server/directory set up, ftp and php coding.
I am assuming that like most of us, you are using a shared server to host your site. As such your webspace is normally arranged with the following structure: -
/home/domain_username/public_html/
When using ftp to upload files to your webspace, they are placed in the public_html folder, so for instance,
www.yourdomain.com/index.html translates to
/home/domain_username/public_html/index.html on the server.
The domain_username part of this structure is usually the same as your ftp username, which should have been provided to you by your hosting company.
When you upload a file to the server via a web page instead of ftp, the file is placed into temporary directory that is created "on the fly" by the server. In order for your web pages to access this file, it needs to be moved to a location within your web space (public_html/uploads/ for instance).
At this point, I think it would be best to do a "walk through" with you.
1. Open up your ftp programme and connect as if you were uploading web page.
2. Create a new folder and call it uploads.
3. Set the permissions on this new folder to RWX-RWX-RWX (CHMOD 777)
Next we'll do the form and the code that handles the upload
PHP Code:
<html>
<head>
<title>Upload File</title>
</head>
<body>
<?php
//Don't forget to change domain_username to whatever your ftp username is
if($submit) {
if ($file1_name != "") {
move_uploaded_file("$file1" , "/home/domain_username/public_html/uploads/$file1_name")
or die("<br />Couldn't Upload Your File.");
}
print("Upload Completed"<br />);
}
?>
<form action="<?php $PHP_SELF ?>" method="post" ENCTYPE="multipart/form-data">
File for Upload: <input type="file" name="file1" value="" />
<br />
<input class=box type="submit" name="submit" value="Upload File" />
</form>
</body>
</html>
If we assume the file you uploaded was a picture called myhouse.jpg, you would then be able to access the picture by going to yourdomain.com/myhouse.jpg
I hope I have interpreted your request correctly and that this is helpful,
Regards
Ian.