473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Download from remote server to mine. Worked but now doesn't.

My script is below. And it worked perfectly until this morning when i got up and went of to try it it didnt work anymore. The code stayed the same so im sure its not that. I think it has something to do with limits on cache or a temporary folder or some other type of limit that my host might have put on without me knowing.

The file goes through the download with out error but when it finally outputs the link and you click on it you get a 404 not found. Through FTP i look and its not there so for some reason it seems that after it downloads it, it doesn't transfer it over to the specified folder. I have checked the CHMODs on everything and just for testing put EVERYTHING at 777.

Can anyone think of something I can try to fix this situation?

[PHP]$link="http://$url";
if($filename=="") { return"link crippled. please check!"; }
if(eregi(".php",$filename)) { $filename="$filename.txt"; }
if(file_exists("files/files$tiam/$filename")) { } else {
echo"Downloading $filename<br><span id=info></span><br>";
$begtime=time();$filex=fopen("$link", "r");
$clog=fopen("files/files$tiam/$filename","a");
if (!$filex) { return "<p>Unable to open remote file. abnormal error. <br><br>"; }


while (!feof ($filex)) {$line = fread ($filex,1024);fwrite($clog,"$line");
$kbf=$kbf+1; $kbx=$kbx+1;if($kbx==100) {
$kbx=0;$nowtime=time();$dura=$nowtime-$begtime+1;$kbs=round($kbf/$dura);
echo"<script>document.getElementById(\"info\").inn erHTML = '<b>$kbf KB @ $kbs KB/s</b>';</script>";}}
fclose($filex);
$tiamx=$tiam;
fclose($clog);mkdir("tmp/$_SERVER[REMOTE_ADDR].$filename",0777);}
$tiam=time();$tiam=substr($tiam,0,7);$tiam=md5($ti am);
rename("files/files$tiamx","files/files$tiam");
return"fetched <b><a href=\"files/files$tiam/$filename\">$filename</a></b>.
click <b><a href=\"files/files$tiam/$filename\">here</a></b> to download it.
<br><br>";[/PHP]
Jan 16 '08 #1
0 1258

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Peter A. Schott | last post by:
Got a strange scenario going on here in that I could have sworn this worked yesterday. I am issuing binary retrieval calls to an FTP server, writing to a file, close the file, then removing the...
5
by: Neil Rossi | last post by:
I have an issue with a particular ASP page on two web servers. Let's call these servers Dev1 and Beta1. Both Servers are running IIS 5, Windows 2000 SP4 with "almost" all of the latest patches. ...
9
by: RvGrah | last post by:
After much hair-pulling, I've finally found the answer to a problem that many are fighting with, difficulty connecting from Sql 2005 Server Management or VS2005 to a remote Sql Server running Sql...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
7
by: clintonG | last post by:
To all Microsoft partners and customers who have been unable to download recently or access ASP.NET documentation from the msdn2 website and for all of those customers who have been lied to and...
0
by: cxian | last post by:
Hi again! I am going really desperate on this problem that I have in downloads. Please somebody who have a better idea to solve things out, please help. Just like I mentioned. I have a site that...
10
by: Mikhail Kovalev | last post by:
Suppose I have something like this $resource = curl_init(); curl_setopt($resource, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($resource, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($resource,...
3
by: axelman | last post by:
Hi guys, I'm using Classic ASP, IIS6, IE 7, FF 3 I've developed a vb script to downloand files hosted in my server (zip, doc, pdf, jpg, xls, et. etc.) it's very straight forward and there's a ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.