Jump to content


Photo

Download Manager


  • Please log in to reply
170 replies to this topic

#121 Dom83

Dom83

    GMC Member

  • GMC Member
  • 138 posts

Posted 20 May 2008 - 04:18 PM

Hi

I find it a bit hard to understand and use. I just want to load a file from my website to a sprite, instead of loading it from the hard disk.
Can someone give me a simple code to do that please ?

Am I obliged to save it on the hard disk ? Can't I download it directly to the memory and use it in a sprite ?
  • 0

#122 paulman8888

paulman8888

    GMC Member

  • New Member
  • 140 posts

Posted 20 May 2008 - 06:31 PM

Hi

I find it a bit hard to understand and use. I just want to load a file from my website to a sprite, instead of loading it from the hard disk.
Can someone give me a simple code to do that please ?

Am I obliged to save it on the hard disk ? Can't I download it directly to the memory and use it in a sprite ?

Asking this is the wrong area.
  • 0

#123 Dom83

Dom83

    GMC Member

  • GMC Member
  • 138 posts

Posted 20 May 2008 - 06:41 PM

I was meaning : Can someone tell me how to make it using Download Manager. I don't get to find out from the example file. Sorry if I sounded off-topic. :)

Edited by Dom83, 20 May 2008 - 06:42 PM.

  • 0

#124 Xantier

Xantier

    GMC Member

  • New Member
  • 362 posts

Posted 21 May 2008 - 12:57 AM

Anything can be downloaded with this. I tried. I found why of file is corrupt error , you have to stop download when it overs. (if download status = bla bla stopdownload)
  • 0

#125 theleaningcandle

theleaningcandle

    Dancing Apple Games

  • New Member
  • 373 posts

Posted 08 June 2008 - 02:21 PM

I've used this DLL several times before, the problem most of you seem to encounter when checking for completed downloads is you place the checking function immediately after the start download function. The download will not complete instantly, so it will return false, then never check again which is why the download is not being closed. I normally use a while loop that freezes the game until the download is complete (i only ever use small text/php files, i would use another method for larger files) but it would look something like this:
download = DM_StartDownload("http://url.com/file.txt');
while(DM_GetStatus(download)!=3)
{
//do nothing
}
//here the file has completed
DM_StopDownload(download);
DM_CloseDownload(download);

Dont quote me on function names or syntax (I havent used this DLL in AGES, but I will be soon) but that is the sort of method I use.
  • 0

#126 chainsawkitten

chainsawkitten

    GMC Member

  • GMC Member
  • 1336 posts
  • Version:GM8

Posted 09 September 2008 - 08:07 PM

I'm having the problem that certain files won't download. It downloads like 333 bytes and then says it's completed.

EDIT: Also, I can not get the filesize. No matter if I use the example or use my own, it's always 0.
EDIT2: I'm stupid >_> Slight error in the URL. I wonder why it downloaded 0 or 333 bytes though =/

The error with filesize is still strange though. Perhaps it's cause I'm downloading too small files (just some kBs) or what?

Edited by chainsawkitten, 09 September 2008 - 08:23 PM.

  • 0

#127 grumpymonkey

grumpymonkey

    GMC Member

  • GMC Member
  • 1011 posts

Posted 19 September 2008 - 02:20 AM

this doesnt work.

i dont get an error or anything, but it wont download them, or will download them corrupted.

i tried downloading a ZIP file form my site(bogwog.987mb.com)
but it downloaded an empty ZIP file

then i tried it again, but from the webserver hosted on my localhost (127.0.0.1/thing.zip)
and the same thing happened >_>

i also tried it with other filetypes like MP3's and text documents, but they dont work
  • 0

#128 Lapixx

Lapixx

    GMC Member

  • New Member
  • 93 posts

Posted 19 September 2008 - 05:53 AM

I've never seen a few scripts that are so easy to use and has so many complainants. The DLL works fine, or better, it works great. It's easy to use when you have read trough the example a tiny bit, what gives me the impression that you obviously did not.

You create a download, you start it, and then you keep checking if it's finished (or if an error occurred). After that you simply stop and close it.

Seriously, by commenting like this, you actually make people think that the DLL sucks and it won't download ANY file. Don't do that anymore -.-

Anyway: Great DLL, if you don't use 39dll (or don't know HOW to use it) this is a good option =)
  • 0

#129 grumpymonkey

grumpymonkey

    GMC Member

  • GMC Member
  • 1011 posts

Posted 20 September 2008 - 10:01 PM

I've never seen a few scripts that are so easy to use and has so many complainants. The DLL works fine, or better, it works great. It's easy to use when you have read trough the example a tiny bit, what gives me the impression that you obviously did not.

You create a download, you start it, and then you keep checking if it's finished (or if an error occurred). After that you simply stop and close it.

Seriously, by commenting like this, you actually make people think that the DLL sucks and it won't download ANY file. Don't do that anymore -.-

Anyway: Great DLL, if you don't use 39dll (or don't know HOW to use it) this is a good option =)

hmm..you know when your posting about what someone said, your supposed to either put a @person, or qoute their post, otherwise they wont understand what your talking about
  • 0

#130 Lapixx

Lapixx

    GMC Member

  • New Member
  • 93 posts

Posted 20 September 2008 - 10:32 PM

It's not that hard to figure out that my post was aimed at your reply. You begin your comment with "this doesnt work", what should be "I can't get it to work".
  • 0

#131 13bgarli

13bgarli

    GMC Member

  • New Member
  • 177 posts

Posted 22 September 2008 - 11:21 PM

I can only download 2 things at once then it freezes???!!!

How can i fix this?
  • 0

#132 chainsawkitten

chainsawkitten

    GMC Member

  • GMC Member
  • 1336 posts
  • Version:GM8

Posted 25 September 2008 - 12:20 PM

I don't know how to fix it since I don't know what you've done wrong.
  • 0

#133 Linera

Linera

    Frost Games Developer

  • New Member
  • 279 posts

Posted 25 September 2008 - 05:44 PM

Sometimes it fails to download a jpeg completely.

At random times it only downloads part of the image and says its completed.

Below is the source code for the downloading and a copy of an incomplete image:

url=argument0
	filename=argument1
	
	TaskName=filename;
	TaskHandle=DM_CreateDownload(url,filename);
	TaskSize=DM_StartDownload(TaskHandle);
	
	while(DM_DownloadStatus(TaskHandle)!=3)
	{
	//do nothing
	}
	
	DM_StopDownload(TaskHandle);
	DM_CloseDownload(TaskHandle);

Posted Image

Edited by Linera, 25 September 2008 - 05:44 PM.

  • 0

#134 chainsawkitten

chainsawkitten

    GMC Member

  • GMC Member
  • 1336 posts
  • Version:GM8

Posted 25 September 2008 - 06:56 PM

Sometimes it fails to download a jpeg completely.

At random times it only downloads part of the image and says its completed.

Below is the source code for the downloading and a copy of an incomplete image:

url=argument0
	filename=argument1
	
	TaskName=filename;
	TaskHandle=DM_CreateDownload(url,filename);
	TaskSize=DM_StartDownload(TaskHandle);
	
	while(DM_DownloadStatus(TaskHandle)!=3)
	{
	//do nothing
	}
	
	DM_StopDownload(TaskHandle);
	DM_CloseDownload(TaskHandle);

Posted Image

That always happened when I stopped and closed downloads when finished. Don't do it and it will work.
  • 0

#135 Linera

Linera

    Frost Games Developer

  • New Member
  • 279 posts

Posted 25 September 2008 - 07:15 PM

Problem is you must close the download before the game can open it.
  • 0

#136 chainsawkitten

chainsawkitten

    GMC Member

  • GMC Member
  • 1336 posts
  • Version:GM8

Posted 25 September 2008 - 07:18 PM

Problem is you must close the download before the game can open it.

Save the files in an array and close all of them when all are downloaded, not when the single file has finished downloading.
  • 0

#137 Linera

Linera

    Frost Games Developer

  • New Member
  • 279 posts

Posted 25 September 2008 - 07:19 PM

Problem is you must close the download before the game can open it.

Save the files in an array and close all of them when all are downloaded, not when the single file has finished downloading.


I don't get what you mean.
  • 0

#138 elogo252

elogo252

    GMC Member

  • New Member
  • 176 posts

Posted 28 September 2008 - 10:44 PM

okay im really confused.
once i have downloaded the file i simply want it drawn right away. Heres my code

[codebox] if (keyboard_check (vk_control))
{
CurDownloads +=1;
Url = get_string ('Please enter the url of your download:','http://');
Name = filename_name ( string_replace_all (Url,'/','\'));
OutFile = get_save_filename ('Files (*.bmp)|*.*',Name);
TaskName [CurDownloads] = Name;
TaskHandle [CurDownloads] = DM_CreateDownload (Url,OutFile);
TaskSize [CurDownloads] = DM_StartDownload (TaskHandle [CurDownloads]);
show_message ("Download Complete")

text2=file_text_open_write('Last Image.txt');
justdwn=file_text_write_string(text2,OutFile);
file_text_close(text2);

DM_StopDownload(TaskHandle);
DM_CloseDownload(TaskHandle);

load = get_open_filename("All Image Files (*.bmp;*.jpg;*.tif;*.png;*.gif)|*.bmp;*.jpg;*.tif;
*.png;*.gif",OutFile);
sprite_replace(mySprite,load,1,true,false,false,fa
lse,0,0);

//show_message (DM_GetContentType (TaskHandle [CurDownloads]))
}
[/codebox]

does anybody now why the image wont simply draw, but does download?
please help if you can
  • 0

#139 epicCreations

epicCreations

    Cool As Ace

  • New Member
  • 1241 posts

Posted 12 October 2008 - 08:06 AM

Whenever I download the .ZIP file, it's always corrupted. Am I doing something wrong?

PS: I can't install WinRAR; don't suggest that I use it.
  • 0

#140 rolyataylor2

rolyataylor2

    GMC Member

  • New Member
  • 35 posts

Posted 17 November 2008 - 05:26 PM

hobble's dll works for downloading it just doesn't know when it is done.

If you set a download and leave it for a long time it will download completely, but if you check to see if it is finished it will say it is finished way before it is actually done. that is why you get the error about the rar or zip file, and why game maker wont load the image, because it was canceled before it was finished, even though the dll returned that it was finished.

I've also noticed that stopping and closing the download doesn't necessarily allow the file to be used. and one more thing that i noticed with alot of dll's out there. if you try to download the something twice when running the game it will give a NT.DLL error no matter if you cancel the downloads or not.

I would like to see it working fully because i could really use it for my program. but meh...

Edit:
if you collect the returned variable from the start_download(my_download) command and divide that by the getProgress(my_download) command it may give you a better result then the GetStatus(my_download) command.
here is the code that finally worked for me
alarm[0]
while(!file_text_eof(argument0)){       DL_ID[total_downloads] = DL_CreateDownload(file_text_read_string(argument0),working_directory+"\"+argument1+"folder.png")       DL_Size[total_downloads] = DL_StartDownload(DL_ID[total_downloads])       DL_Done[total_downloads] = false       total_downloads+=1}

draw event:
draw_text(xx,yy,string(total_complete)+" of "+string(total_downloads-1)+" Completed")for(i=0;i<total_downloads;i+=1){    if DL_GetProgress(DL_ID[i]) != 0 and DL_Done[i] = false    if (DL_Size[i]/DL_GetProgress(DL_ID[i])) = 1    {        total_complete += 1        DL_StopDownload(DL_ID[i])        DL_CloseDownload(DL_ID[i])        DL_Done[i] = true    }}

Hope that helps others

Edited by rolyataylor2, 17 November 2008 - 05:51 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users