Does a Trigger.io reload delete all locally saved files? - reload

The docs say that forge.file.saveURL() saves a file in "a permanent location", but when I perform a reload on my app and restart it, all the files that were previously downloaded and saved locally are downloaded again.
What actually happens to the local file store on reload, and is there a way to persist files? I'd like to be able to update and reload a line of JS without forcing the user to redownload megabytes of image and audio files.

I've not been able to recreate any saveURL problems with Reload - what I did:
create a new app
use file.saveURL and prefs module to download a file and remember its location (https://gist.github.com/goodgravy/6539470)
run the app - image is shown in app
make a small change to the app (e.g. some text in index.html)
push out Reload update
switch away from app, wait for Reload to be downloaded, switch back to app
index.html change has been made, and image is still shown from original saved location
I tried that out on Android 4.2 and iOS 7.
Could you try that stripped-down app I linked to to see if you're seeing the same thing? If it is still a problem, please let us know what device and OS version you're on there.

Related

Trying to use live server package on text editor atom

I am trying to use the live server package which works pretty much like livereload for editor Atom. The server runs fine, but the files do not get automatically refreshed whenever I make changes + save the files..
Not sure if this is normal, but when I open up the server on the browser, I am forwarded to a directory with all the files on the server. How do I change this so that the server renders HTML only and refreshes every time changes are made?
My php files with html elements dont open, so create the file like .html files, and everythings runs well. Use .atom-live-server.json on the root project to change some options like other browsers.
Edit 1: Have the solution !
1- Install Live Reload from livereload.com.
2- Install Live Reload from browser extension.
3- Copy and paste this before before body:
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
4- Execute live reload and the browser and still works for php files.
You haven't set the project folder for the live-server to operate from, or you've saved the file you want to view outside of where it is running from.
In the project window on the left, add the project folder that you are using, and remove anything else. Or save your file in that location.
I had the same problem with atom-live-server and Google Chrome browser. Finally made it work using these steps:
Open your Browser
In Project pane open the project folder that you want to test
Start the atom-live-server
It should automatically open a new page in your browser. Right click on it and select Inspect -> it will open Console window.
Your Live reload is enabled. Notice the message in the Console.
After you make changes in your javascript or html in Atom save your changes (Ctrl + S) and the browser page will be updated.
I fixed it by adding the <head> and <body> tags to the html file I was editing. (even though I don't always include them anymore at least one is needed for the "Live reload" server to work.)
Live reload won't work unless there's a tag in the HTML the script can be injected on (body, head, and svg).
see this github issue!

How to prevent WebStorm temp files constantly launch Meteor rebuilt

Each time I write something into WebStorm IDE Meteor rebuilds. Even if I don't save the files. My computer becomes noisy and hot quickly.
I am looking for a way to prevent Meteor to watch WebStorm temp files.
Does this happen when debugging your code? If yes, this must be a Live Edit issue. Try disabling Live Edit plugin - does it help?
Look at the synchronization section of the system settings page from their documentation
Here's what it says:
Synchronization
Synchronize files on frame or editor tab activation
If this check box
is selected, all the files that were changed externally are reloaded
from disk when you switch to WebStorm from a different application, or
when you you switch to their editor tab.
Save files on frame deactivation
If this check box is selected, all
modified files are auto saved when you switch from WebStorm to a
different application. Note that you cannot disable autosave
completely by turning off this and the following option. See Saving
and Reverting Changes.
Save files automatically if application is idle for N seconds
If this
check box is selected, all modified files are auto saved at regular
time internals. See also, Saving and Reverting Changes.
Use "safe write" (save changes to a temporary file first)
If this
check box is selected, a changed file is first saved in a temporary
file. If the save operation succeeds, the file being saved is replaced
with the saved file. (Technically, the original file is deleted and
the temporary file is renamed.) Also, the ownership of such file
changes. If this check box is not selected, the ownership of a file
does not change, but all the advantages of safe write will be lost.
Try unchecking those checkboxes and see if that prevents some saves.
I had a similar problem in that WebStorm was constantly saving edits to Jade files, even after typing just one character, triggering a gulp watcher. Disabling the Live Edit plugin and unchecking these boxes worked for me. Since disabling Live Edit didn't work for you, maybe unchecking one or more of these boxes will fix it.
Check this meteor specific webstorm help article. There is detailed description on how to configure live edit and code updating and how that would work together with meteor.

Can I use a custom logo for downloaded url files?

My site has an option to download a shortcut (.url) file onto the user's PC by clicking a link. The idea is that users then can save this to their desktop, and use it a shortcut to the site for future visits. (I know it's wacky, but it's what my client wanted.)
I have an icon(.ico) file that I wish to use, but whenever the user downloads the file the icon is not shown.
I've tried opening the URL file in notepad and editing the IconFile value to point to the icon file on the server itself.
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=http://example.com/
IDList=
HotKey=0
IconFile=http://example.com/favicon.ico
IconIndex=0
However this does not seem to work. Can anyone suggest what might be wrong, or how I can fix it.
MS Windows does not load icon files specified with ´IconFile´ from the internet (for security reasons, I guess).
Rather it only loads the ´IconFile´ from
local file if the path is a file path, or
local web cache if the protocol is http:
You can verify this by navigating Internet Explorer to http://example.com/favicon.ico (now file is in cache) and then refreshing your *.url file (by right-clicking -> Edit -> [Make a fake change])
Now the icon should be displayed. Now clear your IE-cache, refresh *.url file, and the icon is gone (replaced by the icon of the default browser)
So,
either your client can tolerate that the default icon is displayed if icon is not cached, or
you have to provide a local copy.

Meteor - Create a file to be downloaded (without triggering meteor to restart)

I want to create a file and then serve it using Meteor, but I don't want the server to restart when I create/update the file in the public directory.
The user will click on a button to create a config file on the server and I want the user to be able to download that config file.
Is there a way to do this without triggering the server to restart?
I have tried creating a link to the file and creating a hidden file but nothing has worked.
Thanks for your time.
Try meteor run --production. That might solve your problem.
Server restarts because you are running it in Development mode,
When it runs in production, it doesn't restart on content changes.
To run in production, only way I know is, after bundling application,
Have a look here: http://docs.meteor.com/#deploying
If you doesn't want to run in production mode, here is a workaround:
In order to prevent reloading, you have to generate your files in a folder that is located outside of your project's repository.
Then you will have your meteor app to serve the content of that folder.
Here is an example that uses the connect npm repository to make your local folder /meteor/generated_files served under the url hostname.com/downloads/:
var connect = Npm.require('connect');
var fs = Npm.require('fs');
function serveFolder(urlPath, diskPath){
if(!fs.existsSync(diskPath))
return false;
RoutePolicy.declare(urlPath, 'network');
WebApp.connectHandlers.use(urlPath, connect.static(diskPath));
return true;
}
serveFolder('/downloads', '/meteor/generated_files/');
I published the very primitive package I have that does just that.

In App downloadable content

I'm trying implement a kind of private 'cloud store' for may web application. Let me explain, I have 'reports' (a file containing queries etc) which can be installed on a client pc. Normally, we e-mail them the files to end users whenever we create new ones and they manually import them into the app (using standard file upload in any browser).
Now we want to take it a step further and create a page which will pull a list of files from our site, eg. www.me.com/reports. The app will go through the list, compare to those installed and display new ones, updated ones etc. An end user could then just click on a button and the files are downloaded on the server and installed.
I'm trying to avoid writing any web server code, I'd prefer to just create a windows authenticated virtual directory that allows for file listing (or something close to this). I'm thinking maybe some javascript that will silently download the file to the client, then upload it back to the intranet iis server. All done without user interaction. Is this even possible?
I'd like to get anyone's thoughts on how something like this could be implemented, and what pitfalls I should watch out for.
Thanks
JK

Resources