September 7th, 2005, 01:13 PM
|
#1 (permalink)
| | SoMuchAnime-SoLittleTime
Join Date: Aug 2003 Location: Plymouth, WI
Posts: 13,871
|
On the website I made, I wanted to have a section that had a place to upload, and download stuff...mostly for school, what could I use to make that? I tried some php thing, but every time I try it, it says that the file can't be written on the server...I am probably not typing something in right... I attached what I am trying to use...
Anyone know of any other progs I can use, or help me with that one I attached? |
| |
September 7th, 2005, 01:14 PM
|
#2 (permalink)
| | Moderator
Join Date: Oct 2001 Location: Winter Park FL
Posts: 5,278
|
Couldnt you just use FTP to upload and download? |
| |
September 7th, 2005, 01:44 PM
|
#3 (permalink)
| | Member
Join Date: Nov 2002 Location: Kent England
Posts: 395
|
99% of files not being able to be uploaded are due to the folder permissions. try changing teh folder chmod to 777. |
| |
September 7th, 2005, 07:42 PM
|
#4 (permalink)
| | Senior Member
Join Date: May 2003 Location: Aus, Gold Coast :)
Posts: 795
|
yeah what carl said... i had the same problem abouit 2 months ago |
| |
September 7th, 2005, 08:54 PM
|
#5 (permalink)
| | SoMuchAnime-SoLittleTime
Join Date: Aug 2003 Location: Plymouth, WI
Posts: 13,871
|
Sorry it took so long for me to reply...I was in the middle of typing one a few hours ago, then the power flickered, and my comp restarted. I thought it was best to wait out the storm, and not be on my pc.
Anyways...I can upload the program to the site without any problems...the problem is that the program itself, once uploaded, can't do it...I'll try that chmod again...I am pretty sure it is at 777 now... |
| |
September 8th, 2005, 06:37 PM
|
#6 (permalink)
| | Member
Join Date: Nov 2002 Location: Kent England
Posts: 395
|
ok
just to test it out run this php script PHP Code: <?
if (isset($HTTP_POST_VARS['Submit'])){
copy ($_FILES['imagefile']['tmp_name'], $_FILES['imagefile']['name']) or die ("Could not copy");
echo "Name: <a href=\"".$_FILES['imagefile']['name']."\" target=\"_blank\">".$_FILES['imagefile']['name']."</a><br>";
echo "Size: ".$_FILES['imagefile']['size']."<br>";
echo "Type: ".$_FILES['imagefile']['type']."<br>";
echo "Copy Done....";
}else{
echo '<form name="form1" method="post" action="" enctype="multipart/form-data">
<input type="file" name="imagefile">
<br>
<input type="submit" name="Submit" value="Submit"> </form>';
}
?> its very very simple and has many faults with it, but it will tell you if you can upload to the folder |
| |
September 8th, 2005, 06:40 PM
|
#7 (permalink)
| | SoMuchAnime-SoLittleTime
Join Date: Aug 2003 Location: Plymouth, WI
Posts: 13,871
|
Run it? You mean like put it in notepad, and save as a .php, upload it to the site right, and open it right? |
| |
September 8th, 2005, 06:42 PM
|
#8 (permalink)
| | Member
Join Date: Nov 2002 Location: Kent England
Posts: 395
|
yep it will open just a form |
| |
September 9th, 2005, 01:57 PM
|
#9 (permalink)
| | SoMuchAnime-SoLittleTime
Join Date: Aug 2003 Location: Plymouth, WI
Posts: 13,871
|
Ya, that worked perfect! Just like I wanted it to!
Will that work right for everything now? Can I just leave it on there, and use it, or will it give me errors for some stuff? |
| |
September 9th, 2005, 02:19 PM
|
#10 (permalink)
| | Member
Join Date: Nov 2002 Location: Kent England
Posts: 395
|
it will work but any one can upload any file that is any size. you just need to limit the script a little take alook at http://www.phpfreaks.com/tutorials/36/0.php , that wahat i used i just tweeked it a bit. read the replys underneath, they will show you some ideas |
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | |
Posting Rules
| You may post new threads You may post replies You may not post attachments You may not edit your posts HTML code is Off | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |