Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-05-2005, 07:30 PM
Moderator
 
Join Date: Jun 2001
Location: BTHO
Posts: 750
Rep Power: 106
MENJ is on a distinguished road
Send a message via ICQ to MENJ
Download Script Problem

Hello, I am having a small issue with a download script. For whatever reason when it downloads/opens a document from the directory, it comes up as an empty file or an error stating it cannot find the correct path. Image files however work just fine. This only happens with text, word, excel more or less anything that requires a separate application to work.

Here is a snippet of my coding:

PHP Code:
<?
$extlimit 
"yes"//limit the extensions of files uploaded
$limitedext = array
(
".gif",".jpg",".png",".jpeg",".doc",".xls"); //Extensions limited
to.
$sizelimit "no"//limit, yes or no?
$sizebytes "2000000"//size limit in bytes
$dl "http:///www.menj.org/upload/"//url where
files are uploaded
$absolute_path 
"Edited for Security"//Absolute path to where
files are uploaded
$websiteurl
"http://www.menj.org/upload/index.htm"//Url
to you website
$websitename 
"MENJ.ORG UPLOAD";

switch(
$action) {
default:
break;
case 
"download":
echo 
"
<html>
<head>
<title>File Download</title>
</head>
<body><a href=$PHP_SELF?action=upload>Upload File</a> <a
href=$websiteurl>Return to $websitename</a>"
;
$list "<center><table width=700 border=1 bordercolor=#000000
style=\"border-collapse: collapse\">"
;
$list .= "<tr><td width=700><center><b>Click To
Download</b></center></td></tr>"
;
$dir opendir($absolute_path);
while(
$file readdir($dir)) {
if ((
$file != "..") and ($file != ".")) {

$list .= "<tr><td width=700><a href='$dl/
$file'>$file</a></center></td></tr>"
;
}
}
$list .= "</table></center>";
echo 
$list;
echo
"
</body>
</html>"
;
Hope someone can help

- MENJ
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-05-2005, 12:08 PM
zaimlah's Avatar
Inspired Webmaster
 
Join Date: Jul 2001
Location: ttdi
Posts: 129
Rep Power: 92
zaimlah is on a distinguished road
the problem might be in the "upload" code. where is the upload code anyway?

is file uploading working as normal? e.g, upload a file, then check if the file exists in the folder using ftp.
__________________
blog:zaim_bakar_blog | biz:box
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
My phpbb script got problem? Webster Website Programming 6 15-12-2006 01:47 PM
download and review script lcf Website Programming 1 20-04-2006 10:48 PM
Mro Ero Bot For Download jun2020 Mamak Stall 1 12-04-2004 09:51 AM
problem i n vb script babysakura Website Programming 2 22-03-2004 08:49 AM
problem in code(VB script babysakura Website Programming 0 30-12-2003 09:09 AM



All times are GMT +8. The time now is 02:21 AM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60