How do I extract file

Get help using Construct 2

Post » Mon Jun 02, 2014 10:18 pm

hi to all, i have added an image in my app, and i would like, when the user click on the button install, i would like that file to be extracted from the app to the desktop for example, it is possible?

thanks
B
34
S
13
G
6
Posts: 1,643
Reputation: 8,761

Post » Tue Jun 03, 2014 7:57 am

Wouldn't the Browser plugin action 'Invoke Download' do this?

from manual:

"Invoke download
Invoke a URL as a file download in the browser. Even if this points to a web page or document, it will be downloaded as a file in the browser interface. The URL can point to any address on the Internet, or it can be the name of any imported project file, or it can be a data URL (useful for downloading canvas snapshots). The filename parameter allows you to choose the filename the browser gives to the download, which can be different to the name of the resource being downloaded."

https://www.scirra.com/manual/110/browser
If your vision so exceeds your ability, then look to something closer.
Moderator
B
131
S
29
G
81
Posts: 5,328
Reputation: 56,630

Post » Tue Jun 03, 2014 5:37 pm

the think is, i dont want for the user to see a downloading window, or confirmation i want just the file to be extracted from the app to the desktop for example
B
34
S
13
G
6
Posts: 1,643
Reputation: 8,761

Post » Tue Jun 03, 2014 5:48 pm

Security isn't going to allow that. It is far too risky. It would mean any site could theoretically install anything they like.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
131
S
29
G
81
Posts: 5,328
Reputation: 56,630

Post » Tue Jun 03, 2014 5:52 pm

but ithe file is inside the app and compiled after for windows so it runs locally not from the web
B
34
S
13
G
6
Posts: 1,643
Reputation: 8,761

Post » Wed Jun 04, 2014 1:33 am

RT
Last edited by CarHazy on Sun Jun 14, 2015 3:09 am, edited 1 time in total.
B
20
S
7
G
5
Posts: 24
Reputation: 4,495

Post » Sun Jun 08, 2014 9:06 pm

nope i still can't copy a file from the app "files" folder to my hdd, and also can't copy a file from an ftp to a folder in my hdd :s
B
34
S
13
G
6
Posts: 1,643
Reputation: 8,761

Post » Mon Jun 09, 2014 6:36 am

I don't know what you've tried but for a text file you'd "request project file" with AJAX and then use "write file" "on completed". But it doesn't work with binary files like png's for instance.

A png file can be saved but it won't open as a png file. I looked in the contents of the saved file and by comparing it with the original png file it appears to be encoded as a different codepage since it's being treated as text. So in short "invoke download" is the only built in option to get a png project file to save to the hard drive. Although presumably there may be some unexposed node-webkit function that works with binary files.
B
91
S
31
G
103
Posts: 5,234
Reputation: 67,754

Post » Mon Jun 09, 2014 9:59 am

well i have done this One butto download, so i put:

on clicked, AJAX request "link+file"
on AJAX lastdata comleted nodewebkit WRITE "c:\temp" to file Ajaxlastdata.

but that doenst work

how to simply copy a file from an ftp to the hard disk??
B
34
S
13
G
6
Posts: 1,643
Reputation: 8,761


Return to How do I....?

Who is online

Users browsing this forum: KTML5 and 6 guests