Old 3rd May 2003, 12:20   #1
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Unhappy Why isn't this working..!?

I have just found out that my whole program is failing due to NSISdl.
This is simply not working:
code:

NSISdl::download "http://dynamic4.gamespy.com/~aow/ddayupdater.php" "C:\argh.txt"



It shows it being downloaded, but I never find "argh.txt" on my C: drive.

I also know that you need to create the output directory before you can download the file, but there is no output directory that needs creating.

-Stu
Afrow UK is offline   Reply With Quote
Old 3rd May 2003, 12:26   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Does your script send a Content-Length: header? NSISdl doesn't yet support downloads without a Content-Length header.

Take a look at our update.php for example:
http://cvs.sourceforge.net/cgi-bin/v...viewcvs-markup

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 3rd May 2003, 12:40   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
So, I need to get it to write that content of the ddayupdates.php to a standard txt file in pure text.
I will have a chat to my web admin about it.

-Stu
Afrow UK is offline   Reply With Quote
Old 3rd May 2003, 13:30   #4
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
NSISdl adds a value to the stack that contains the error description. You might want to check that.
Joost Verburg is offline   Reply With Quote
Old 3rd May 2003, 13:43   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
LOL this is what it says:
Quote:
"Server did not specify content length."

Does this conclude anything?

-Stu
Afrow UK is offline   Reply With Quote
Old 3rd May 2003, 13:57   #6
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Exactly what kichik said, the server should send a Content-Length header.
Joost Verburg is offline   Reply With Quote
Old 3rd May 2003, 16:04   #7
Edgeman
Junior Member
 
Join Date: May 2003
Posts: 1
For any of you people that have a database and are displayign lots of things, here's what I did:

<?php
include('functions.php');
ob_start();

header("Content-Type: " . "text/plain");

db_open();

$map_vault = mysql_query("SELECT game, map_name, file_name, author, description, type, file_size, released, section, datetime FROM map_vault WHERE game = 'dday' ORDER BY file_name");

echo "Section Maps\n";

while ($map = mysql_fetch_array($map_vault))
{
$output = $map["file_name"] . ".bsp|" . $fileplanet . "dday" . "/maps/" . $map["file_name"] . ".zip|" . $map["description"] . "|Author: " . $map["author"] ."\n";
print $output;

}
echo "SectionEnd\n";

$size = ob_get_length();
header("Content-Length: $size");
ob_end_flush();
?>

(note the ob_ stuff) This took me like an hour of tryign to get to work. ALWAYS check the php.net manual for ths stuff. Within 10 minutes of looking around, I found the ob_get_length, which solves all my problems.
Edgeman is offline   Reply With Quote
Old 3rd May 2003, 16:32   #8
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
code:

NSISdl::download "http://dynamic4.gamespy.com/~aow/ddayupdater.php" "C:\argh.txt"



AS I see it.
The plugin download a file name ddayupdater.php, then copy it to the "C:\" drive the file argh.txt

I think because there are diferent names.
Try using, instead of "argh.txt" use "ddayupdater.php"

code:

NSISdl::download "http://dynamic4.gamespy.com/~aow/ddayupdater.php" "C:\ddayupdater.php"



Now, if you wanna download the file as "argh.txt", rename it after
download ddayupdater.php.

code:

NSISdl::download "http://dynamic4.gamespy.com/~aow/ddayupdater.php" "C:\ddayupdater.php"
Rename "C:\ddayupdater.php" "C:\argh.txt"



That's my opinion.
Helps????


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 3rd May 2003, 17:00   #9
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Lobo Lunar, that's not true. Why would there be a filename feature if it doesn't work?. Read the topic, there is already a solution
Joost Verburg is offline   Reply With Quote
Old 4th May 2003, 02:49   #10
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
Lobo dumb for not reading well the replies.
Lobo say sorry.
Lobo out


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump