Jump to content

XiaoRulez

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

XiaoRulez's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. well, for the time being, I'm taking out the content length, it seems to fix it up a bit. what would happen if i set the content just a kb over the actual? will people die?
  2. i did this: $s=fread($fp, $block_size); echo(''.strlen($s)); 302...lol but when i have echo($s); only echos 287 characters... maybe archives have special characters :S, cos it works with practically every other file type... damages rar, zip, even uha :S couldn't try ace... can't afford it rmvb's, and avi's seem perfect. i was also wondering if there was a way for the script to load like a buffer? cos it's just sending the whole file as fast as it can (ie. HDD goes crazy for about a few seconds, then stops...lol)
  3. :S i don't want to use readfile, because as some of the files are WAY over 100mb, i really don't wanna blow my memory by loading 100 megs into it with readfile :S
  4. :S nope, "header("Content-Transfer-Encoding: binary");" dosn't fix it. it always has problems at the last % or so... wither the files are large or small... maybe the connection is cut just before it finish's... need my phpinfo for a better idea?
  5. okok, i got news... lol, it works under FlashGet (a download manager), but not firefox or ie or even opera 8... in IE it displays as 287 bytes after download, but in opera, it displays as the correct 302b, however, only 302 is downloaded... :S i really need this done, i'm expecting this script to go live in a week or 2 Y_Y
  6. Heres what i got: session_start(); function send_file($path, $name) { ini_set("max_execution_time", "".(60*60*24)); // 24 hours header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Length: '.filesize($path)); header('Content-Disposition: attachment; filename="'.$name.'"'); header("Pragma: no-cache"); header("Expires: 0"); $fp = fopen($path, 'rb'); while(!feof($fp)) { if(connection_aborted()) die(); echo fread($fp, 1024); flush(); } fclose($fp); } if (@$_SESSION['fid'] == base64_encode(session_id())) send_file(base64_decode($_SESSION['file']),base64_decode($_SESSION['fname'])); Now, heres my problem; Everything works fine exept rar files, i tryed: rar, zip, txt, asm a 302 byte rar file only sends 287 bytes :S i checked the filelength, which was 302 in the header. maybe something in in the rar's end of file? oh, and 1 more funny thing, if i remove the content-length header, it works. but i need it... output for die('Content-Length: '.filesize($path)); was Content-Length: 302 Apache 1.3.X, PHP 5.1
  7. kool, thanks. ;D Kinda off the php topic: I was told about, by someone, that i might be able to set a Cron job for the updates... I'm using CPanel, how might i do this? eg, all rows in table 'users' change the value of all 'credit' +1 if 'credit' isn't over 300
  8. well, i got this file db_update.php normal execution time for the current database size is about just over 5 minutes. all it does is it updates a few variables for each user. The execution timeout for the new another server i'm working on is only 120 seconds. Is there a way for me to change the execution time within the script? Because it also decides wether or not to update based on a few things. i can't have it allowing a 10 minute execution for all files.
  9. :S i'm kinda used to C++ any we don't need to use that all the time :P thanks a heap.
  10. This is a class i wrote and it's giving me crap -_- it should be counting up but the thing is, it's just staying at 0 and not changing, or any changes made goes back to 0 again ($items variable)... (think it's got to do with php thinking that $itams = 0, the 0 is seen to be NULL?) can anyone spot any mistakes? [code]class lists { private $item = array(); private $items; function lists() { $items = 0; } function push_back($var) { $item[$items] = $var; $items++; echo '[New Item] Current Items: '.$items.'<br>'."\n"; } function push_front($var) { $temp = array(); $temp[0] = $null; $count = 0; foreach($item as $i_one) { $count++; $temp[$count] = $i_one; } $item = $temp; $items++; } function pop_back() { $temp = $item[$items-1]; $item[$items-1] == $null; $items--; return $temp; } function pop_front() { $temp = $item[0]; $temp2; $count = 0; foreach($item as $i_one) { $count++; if ($count != 1) $temp2[$count] = $i_one; } $temp2[$count] = $null; $item = $temp2; $items--; return $temp; } function size_of() { return $items; } function erase($loc) { if ($loc > $items || $loc < 0) return $false; else { $temp = $item[0]; $temp2; $count = $loc; foreach($item as $i_one) { $count++; if ($count != 1) $temp2[$count] = $i_one; } $temp2[$count] = $null; $item = $temp2; $items--; return $true; } } function at($loc) { return $item[$loc]; } } $a = &new lists(); function new_a($name) { global $a; $size = $a->size_of(); $a->push_back($name); } $name2 = "who"; new_a($name2); new_a($name2); new_a($name2);[/code] [quote][New Item] Current Items: 1 [New Item] Current Items: 1 [New Item] Current Items: 1[/quote]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.