|
|
|
|
![]() ![]() |
Mar 19 2006, 05:52 AM
Post
#11
|
|
|
NiGHTFoX - Hiding in the dark Group: Members Posts: 680 Joined: 3-April 05 Member No.: 3,584 |
vujsa, I am sorry, I forgot to mention that I had tried the FTP option earlier. The network administrator here is a real security-paranoid. Heh... they all seem to be that way, lol. Perhaps if you're interested, you can upload files directly through cpanel to your web space. Here's a HOWTO: 1) Login to cPanel (http://yourURL/cpanel) with your username and password. 2) Under "Site Management Tools" in the first row, last column, you should see an icon labled as "File Manager". Click it. 3) A new window will open. You should see your home directory (outside public_html folder). Click the folder icon (NOT the folder name!) next to "public_html" 4) Click on the link in the top "Upload files" and you can upload 12 files at once! 5) Click on the link in the top "New folder" to add a new folder. 6) Click on a folder or file NAME (not the icon) to change its properties (CHMOD, re-name, etc), delete, edit, etc. Good Luck! This will be much easier and is built into cpanel. You won't need to worry about getting a PHP script in and then keeping that script secure. Best of luck with building your site the hard way (uploading through cpanel) but I suppose with security freaks on the other end of the proxy, you'll have to do it this way. [N]F |
|
|
|
Mar 21 2006, 01:12 PM
Post
#12
|
|
|
Cosmic Overlord Group: Members Posts: 571 Joined: 26-November 05 From: Denver, Colorado, US Member No.: 9,811 myCENTs:45.66 |
nightfox, I cannot use the FTP option and the cpanel (that port is blocked). I have to go out to a net cafe to do it. Hence, I came up with this option that may work out.
|
|
|
|
Mar 31 2006, 09:48 AM
Post
#13
|
|
|
Member [ Level 1 ] Group: Members Posts: 49 Joined: 7-March 06 Member No.: 11,803 |
Hi!
I was actually working on a PHP script to do just that. And unfortunately, it seems it won't work, for some reason. I've been asking around to find out what's wrong (I see the file isn't even uploaded as temporary file) and it may be that the PHP server in Astahost is running as root, and as such we needed root access to do the file upload... Not entirely sure though. EDIT: Actually, it looks like the PHP upload_tmp_dir variable is empty, and that's why I can't put the files there as well... This post has been edited by KazDoran: Mar 31 2006, 09:55 AM |
|
|
|
Mar 31 2006, 12:02 PM
Post
#14
|
|
|
Member [ Level 1 ] Group: Members Posts: 49 Joined: 7-March 06 Member No.: 11,803 |
Yay I got it to work!
Here's how it goes, a very simple script, without password verification: 1) CHMOD your /tmp directory to 775 (very important!) 2) Create a form like this: CODE <form enctype="multipart/form-data" action="process.php" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="50000" /> File: <input type="file" name="uploadedfile"><br> <input type="submit" value="Submit"> </form> You MUST have enctype="multipart/form-data" or the file upload won't work! MAX_FILE_SIZE limits the maximum file size, in bytes (in this case, around 50 KB). 3) Now the script inside process.php: CODE <? $upload_dir="upload/" $upload_path = $upload_dir . basename($_FILES['uploadedfile']['name']); if(!move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $upload_path)){ echo "Upload failed."; } ?> Set the $upload_dir variable to whatever directory you wish to upload the file to. The $upload_path variable will be the relative path to the file when it's in place. If by any chance the file fails to upload, you'll be notified. Hope this will help. To create a password protection just create a new form where you type the password and do a basic check to see if it matches. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 5th December 2008 - 04:54 PM |