1 Question <----NOOB

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Alex_CTZ
Posts: 21
Joined: Fri Jan 10, 2014 11:38 pm

1 Question <----NOOB

Post by Alex_CTZ » Thu Apr 17, 2014 7:24 pm

Hey guys,
I am trying to get it so when the user clicks button it downloads a certain file into a path such as "C:\Program Files\Server"

Ive tried using the "get" method but I don't know how to chose where to save the file. PLEASE HELP!

atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm

Re: 1 Question <----NOOB

Post by atout66 » Thu Apr 17, 2014 7:56 pm

May be you could find the answer in this lesson:
http://lessons.runrev.com/s/lessons/m/4 ... put-output

Sorry, I can't help you farther, I'm a beginner too :wink:

Kind regards, Jean-Paul.
Discovering LiveCode Community 6.5.2.

Alex_CTZ
Posts: 21
Joined: Fri Jan 10, 2014 11:38 pm

Re: 1 Question <----NOOB

Post by Alex_CTZ » Thu Apr 17, 2014 8:05 pm

atout66 wrote:May be you could find the answer in this lesson:
http://lessons.runrev.com/s/lessons/m/4 ... put-output

Sorry, I can't help you farther, I'm a beginner too :wink:

Kind regards, Jean-Paul.
Cheers Ill check it out ;)

Alex_CTZ
Posts: 21
Joined: Fri Jan 10, 2014 11:38 pm

Re: 1 Question <----NOOB

Post by Alex_CTZ » Thu Apr 17, 2014 8:06 pm

Sorry not what I was looking for, can any 1 help?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: 1 Question <----NOOB

Post by dunbarx » Thu Apr 17, 2014 8:18 pm

Hi.

If you are successful with the "get URL..." portion, is it just that you don't know how to save it to a file?

Look at the "open" and "write to file" commands.

Craig Newman

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: 1 Question <----NOOB

Post by jmburnod » Thu Apr 17, 2014 8:28 pm

Hi Alex,

Try this

Code: Select all

on mouseUp
   put url "http://www.alternatic.ch/jmb/DevLiveCode/OneText.txt" into tText
   ask file "Save to" with "Untitled.txt"
   if it <> empty then put tText into url("File:" & it)
end mouseUp
Best regards
Jean-Marc
https://alternatic.ch

Alex_CTZ
Posts: 21
Joined: Fri Jan 10, 2014 11:38 pm

Re: 1 Question <----NOOB

Post by Alex_CTZ » Thu Apr 17, 2014 8:51 pm

Code: Select all

on mouseUp
   create folder "C:\Program Files\GNTool"
   get url "DOWNLOADLINK"
   open file "C:\Program Files\GNTool" for write
   write to file 
end mouseUp
I dont understand how to layout the save after "write to file" I want the path to be "C:\Programfiles\GNTool" and I want to save the file as "server"
also, how do I send a message with the "get url" so that once the download is complete a message comes up.


-Thanks, Im a complete newbie and Im loving how helpful the community is here.

Alex_CTZ
Posts: 21
Joined: Fri Jan 10, 2014 11:38 pm

Re: 1 Question <----NOOB

Post by Alex_CTZ » Thu Apr 17, 2014 9:57 pm

Sorry to bug but any help?

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: 1 Question <----NOOB

Post by Simon » Thu Apr 17, 2014 10:51 pm

Code: Select all

create folder "C:/Program Files/GNTool"
set the defaultFolder to "C:/Program Files/GNTool"
put url "http://www.blabla.com/index.html" into url "file:index.html") 
Is that what you are trying to do?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Alex_CTZ
Posts: 21
Joined: Fri Jan 10, 2014 11:38 pm

Re: 1 Question <----NOOB

Post by Alex_CTZ » Thu Apr 17, 2014 11:02 pm

Simon wrote:

Code: Select all

create folder "C:/Program Files/GNTool"
set the defaultFolder to "C:/Program Files/GNTool"
put url "http://www.blabla.com/index.html" into url "file:index.html") 
Is that what you are trying to do?

Simon
Im trying to make it so when a user clicks the button it downloads a file and saves it in "C:\Programfiles\GNTool"

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: 1 Question <----NOOB

Post by Simon » Thu Apr 17, 2014 11:07 pm

Well did the code I wrote work?

Simon
Oh I see I left a trailing ")"... remove that.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Alex_CTZ
Posts: 21
Joined: Fri Jan 10, 2014 11:38 pm

Re: 1 Question <----NOOB

Post by Alex_CTZ » Thu Apr 17, 2014 11:55 pm

Simon wrote:Well did the code I wrote work?

Simon
Oh I see I left a trailing ")"... remove that.
It does altohugh its not for html its for a .exe file

-Thanks

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: 1 Question <----NOOB

Post by Simon » Fri Apr 18, 2014 12:00 am

Use
...into url "binfile:index.exe"

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply