Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Tip : A way of making your programs beeing able to download files (from http)

Author
Message
Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 12th Mar 2006 09:25


Exponition : This small code snippet will call windos explorer, and give it the downloading instructructions, and it will ask you do you want to save or run the file..

On slower internet connections, internet explorer might actually run (i mean you might actually see it while its connecting to download site), but on faster connection this shouldn`t be visible.(it also depends on web sites, ammount of space of your file,..)

I know this isn't a great way to download files from http protocol, so i DO suggest using FTP for this (file exchange,download,etc.)

Currently working on (trying) making a new 3d engine for/within dark basic classic out of basic 2d commands, with vertex edit supported.
nojbox87
19
Years of Service
User Offline
Joined: 26th Jun 2005
Location: England
Posted: 12th Mar 2006 16:11 Edited at: 13th Mar 2006 13:26
ooo that could prove very useful. thx a lot dodic

[edit]
I used it for my liberty basic program but the theory works for both so thanks
[/edit]

I am a Christian and I know that God loves me. That is what makes my life so great!
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 14th Mar 2006 22:35
Quote: "ooo that could prove very useful."



o.O wtf...

This is also standing in a help file.
Are the new programmers forum kiddies?

hehe just kidding

[/center]
Image All
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 14th Mar 2006 23:22
What if we want to initiate the user's primary browser? Not everybody uses IE I sure don't

FunkyStickmen: Battle of the Races (1%)
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 15th Mar 2006 13:56 Edited at: 15th Mar 2006 14:02
Argh! Use the help file pls
hmm.... listen:

Quote: "execute file "explorer",url$,"""

and if you searched in the index you would get:

EXECUTE FILE
This command will shell execute a file. The commandline is used to pass additional data into the file being executed. The directory is used to optionally specify a directory other than the current directory. The file must exist or the command will fail. Passing a document, rather than an executable as the filename will cause the document to be opened. If the optional Wait Flag value is set to one, then the application will wait until the executable has finished.

SYNTAX

EXECUTE FILE Filename, Commandline, Directory, Wait Flag

=== THERE IS ALSO AN EXAMPLE === (exam16.dba)

...
execute file "C:WindowsNOTEPAD.EXE",commandline$,directory$,1
...

==> If you use Firefox :
C:/programs/Mozilla Firefox/firefox.exe

execute... and... IT WORKS



ps Ive also never used this command but I searched and I found...
and it isnt so difficult

@ Dodic
thanks that you have decided to help others.
But print the next time your example and the DBC Syntax
(EXECUTE FILE Filename, Commandline, Directory, Wait Flag)
Thanks a lot

[/center]
nojbox87
19
Years of Service
User Offline
Joined: 26th Jun 2005
Location: England
Posted: 16th Mar 2006 10:42
so basically in the options of your program give them a chance to enter their internet sotware thingy. e.g. firefox, or IE

I am a Christian and I know that God loves me. That is what makes my life so great!

Login to post a reply

Server time is: 2025-05-23 21:04:21
Your offset time is: 2025-05-23 21:04:21