Download Manager
#121
Posted 20 May 2008 - 04:18 PM
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 ?
#122
Posted 20 May 2008 - 06:31 PM
Asking this is the wrong area.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 ?
#123
Posted 20 May 2008 - 06:41 PM
Edited by Dom83, 20 May 2008 - 06:42 PM.
#124
Posted 21 May 2008 - 12:57 AM
#125
Posted 08 June 2008 - 02:21 PM
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.
#126
Posted 09 September 2008 - 08:07 PM
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.
#127
Posted 19 September 2008 - 02:20 AM
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
#128
Posted 19 September 2008 - 05:53 AM
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 =)
#129
Posted 20 September 2008 - 10:01 PM
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 aboutI'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 =)
#130
Posted 20 September 2008 - 10:32 PM
#131
Posted 22 September 2008 - 11:21 PM
How can i fix this?
#132
Posted 25 September 2008 - 12:20 PM
#133
Posted 25 September 2008 - 05:44 PM
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);
Edited by Linera, 25 September 2008 - 05:44 PM.
#134
Posted 25 September 2008 - 06:56 PM
That always happened when I stopped and closed downloads when finished. Don't do it and it will work.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);
#135
Posted 25 September 2008 - 07:15 PM
#136
Posted 25 September 2008 - 07:18 PM
Save the files in an array and close all of them when all are downloaded, not when the single file has finished downloading.Problem is you must close the download before the game can open it.
#137
Posted 25 September 2008 - 07:19 PM
Save the files in an array and close all of them when all are downloaded, not when the single file has finished downloading.Problem is you must close the download before the game can open it.
I don't get what you mean.
#138
Posted 28 September 2008 - 10:44 PM
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
#139
Posted 12 October 2008 - 08:06 AM
PS: I can't install WinRAR; don't suggest that I use it.
#140
Posted 17 November 2008 - 05:26 PM
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 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











