How to set up download path of Epub file - download

How can I set up my epub book (I made it) to be download to other folder than download folder on Android phone?.
Maybe to be downlaoader to folder where Kobo reader keeps Epub files?
Can i do than in manifest file?
Thnaks in advance.

In general, you cannot control from within your EPUB file where it is going to be downloaded on the filesystem of a particular device. (For example, on iOS there is no user-accessible filesystem, and EPUB is just a document format, like PDF or ODT!)
Where an EPUB file, once downloaded, ends up depends on which apps are available on the user's device.
For example, certain apps might register a suitable Intent and be able to "intercept" the EPUB file when you click the download link in the browser: once the download is completed, they might "move" the downloaded file into their app storage directory. Other apps might register an Intent telling Android that they can "open" EPUB files, but the app itself will not manage the download and file move, likely resulting in the EPUB file to be downloaded in the "Download" directory.
If you control the Web server from which users will download the EPUB file, you can make sure to set the appropriate MIME Type (served by the Web server) for the .epub file. See e.g. this: https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Configuring_server_MIME_types

Related

How to red an external file during the installation of an .appxbundle

I want to distribute my UWP app using side-loading.
I have created the .appxbundle using Visual Studio, and also EV code-signed it.
So, when the user clicks on the .appxbundle file, my app is properly installed and the user can start working with it!
In this way, I can place such .appxbundle on my website, and the users can download and install it. Marvelous.
Now, I would like to customize each download, by adding a file with some tracking information to attribute a download e.g. to a specific ad campaign that I am running.
So my server can generate a ZIP file containing the .appxbundle and a little .txt file containing the tracking info (I need to generate a separate file because the signed .appxbundle takes too long - several minutes - to regenerate each time).
The user then unzips the ZIP file, clicks on the .appxbundle and installs the app.
The tricky part is that, during the installation of the app, I would like to copy the .txt file into the LocalState folder of the app that is being installed.
Is it possible?
How can I do that?
Thanks!
If your users are going to install the app by clicking a ms-appinstaller:// link, you can attach extra data using the activationUri.
This can be a custom URL scheme that you register for your app with any url parameters. The appinstaller will call this url once the app is installed.
We use this to pass login information to the app, like this:
ms-appinstaller:?source=https://localhost:8000/myApp.appinstaller&activationUri=my-app-track-install:?campaign=billboards
If your app registers for the my-app-track-install url scheme in the Appxmanifest, then from the apps perspective the first launch is then a url activation with the url you added as activationUri. In your case you would track the install, and then proceed to launch the app normally.
You can find more info on this in the example and remark for this (semi-related) api-documentation:
https://learn.microsoft.com/en-us/uwp/api/windows.applicationmodel.package.getappinstallerinfo?view=winrt-19041

Reason why folder associated with saved webpage gets deleted when we delete saved page

I have saved a complete webpage and there is also one folder saved with resources but when I delete webpage or move saved webpage to other directory then the folder associated with it also gets deleted or moved. So what is the code written behind it. Because I want to do same with my webpage and folder.
Thanks in advance for you kind help.
This "association" between the HTML file and its resources folder is a behaviour implemented by the Windows operating system.
It has nothing to due with a webpage in particular, with its HTML, JavaScript, or even with a particular browser.
Windows 2000 provides a simple way to connect a primary HTML file to its group of associated files. If Connected Files is enabled, when you perform any of the commands [Copy, Cut, Paste, Move, Delete, Send To] on a file or folder of associated files, the same command is performed on all connected files.
Even though the official page mentions "Windows 2000", the same behaviour is implemented in Windows XP and many (if not all) later versions of Windows.
See these pages:
Removing file / folder link after using “Save As…” then “Web Page, complete”
Operations on an HTML file or folder apply to similarly named folder or HTML file (from Microsoft support)

How can I associate a file with my app?

I have a Cocoa app "PDFHistory" on Mac OS X that uses the NSDocument architecture to save and load PDF files that are internally formatted specially for my app. I want to make it so whenever I save a file (e.g., "mydoc.pdf") from PDFHistory, then subsequently double-clicking on mydoc.pdf will automatically open it in PDFHistory.app. However, I don't want to make it so all .pdf files are automatically opened in PDFHistory, but rather use the system default (probably Preview.app). The .pdf suffix is a requirement, though, since I need the user to be able to e-mail the files to other users who can view the file in their default PDF viewer.
The problem is that if I set the LSHandlerRank to "Owner", then all .pdf files will be opened with PDFHistory, which is bad (since I only understand the internals of the .pdf file that PDFHistory wrote out). But if I set LSHandlerRank to "Alternate", then all .pdf files will be opened to the system default app (Preview.app), which is confusing for the user who had just created the file using my app.
Once upon a time, "creator codes" could be used to implement this sort of capability, but launch services started ignoring them back in Snow Leopard (see http://tidbits.com/article/10537). UTIs are not a substitute that provide this capability (see http://boredzo.org/blog/archives/2009-09-22/how-not-to-use-utis).
Using Finder to get info on the file allows the user to specify a specific app to use to open the specific file. This supposedly works by setting a "usro" property in a the file's resource. There is some open-source code to mimic this behavior (https://github.com/AlanQuatermain/SetAppAffinity), but is uses deprecated functions, and so would cause Apple to reject the app from the App Store. Similarly, people have posted AppleScript to set this property (https://discussions.apple.com/thread/2597365), but sandboxing would prevent me from invoking it.
Although the .pdf suffix is a requirement in order to be able to send the files to users on other systems/platforms, I considered trying to have the suffix registered with two extensions as ".phistory.pdf", which would allow "file.phistory.pdf" to be opened in PDFHistory, but "file.pdf" would be opened in the default PDF viewer. However, this simply didn't work: it appears that the final suffix is the only one used by launch services, and everything before that is ignored.
So is there any way to have my app be the default app for opening files that it created itself?

How to configure an autorun.inf file?

I was wondering if I can create an autorun.inf file that does not run an .exe file. Intstead, it can open up a web browser or plays a video. How do I go about doing these steps? Of course, I do know that some .inf files can be detected as a virus, but this autorun.inf file I wish to do is clean.
Advice on how to do this is appreciated.
basically, everything you put in the open= portion of the .inf will be opened with the default associated application, or executed.
If you put a web address in there like this :
open=http://www.google.com
it will open google.com in the system's default web browser.
you can (of course) always check the docs Microsoft provides.
http://msdn.microsoft.com/en-us/library/windows/desktop/cc144200(v=vs.85).aspx

How to done file manipulations in WP7

I am developing a windows phone application. In this app I am downloading some files and stored them in isolated storage. I need to open these files. For that I tried different methods, but I can't.
The same question is asked here.
The answer says I cannot open a file from isolatedstorage. But I am trying the same in the Mail Client in my Windows Phone (hotmail client). I sent some .doc, .ppt, .pdf, .xls to my email and tried to open these attached files in my phone through mail client. I can open the files in my phone. I need to do the same in my application also. How can I do this in my app?
You will not be able to open these types of files from the isolated storage. There is no way for third-party applications to launch the external application required for viewing these file types. The Mail Client is a native application that runs outside the protected sandbox which third party apps are subjected to.
One solution you can utilize though is to upload the file to an external server and launch it using the WebBrowserTask class. I am not going to give the code required to upload the file, as that will depend on your environment, but once uploaded, here is how you can launch it:
WebBrowserTask webBrowserTask = new WebBrowserTask();
webBrowserTask.URL = "http://www.foo.com/bar.pdf";
webBrowserTask.Show();
I should mention that this will only work for an external file. It will not work if you try to reference a file in isolated storage. You will need to upload the file somewhere.

Resources