How HTML file upload works? - html

HTML uses form to send data to web server. The data can be included in the url parameters or embedded in HTML Request body. But for a file, I don't know how it works. I want to know this because I see some difference between uploading file on web and desktop applications.
The desktop application usually provides a text box to allow the user input the locale path of the file. But for web applications, the text box is usually read only.It displays the file path when the file gets selected with the browse button. Is that just a design issue between desktop and web?

Question is a bit unclear, but one important aspect about web applications (or HTML forms) is that they are sandboxed and cannot access local files directly. So the file upload picker does not allow direct input of the file name (which might be scripted), but only selection through an OS (or browser) supplied file choose UI (that the app or page cannot mess with).
Once the user has selected the file the page can access it, but it cannot make the selection itself (or surreptitiously).
A recent trend is to lock down desktop apps in the same manner. See for example Apple's sandboxing restrictions, that also do not allow apps to open random files without user intervention.

Is that just a design issue between desktop and web?
The implementation of a file upload form, whether desktop or web, is largely unimportant to the end result. Both desktop and web controls can utilize either a path string or a full-blown file navigator, though a desktop app is more likely to vary in its implementation. The only other difference is the destination: desktop apps tend to parse the file in memory and render it somehow, while web apps almost invariably upload it to a server (though this is subject to change: see the HTML5 file API), which then further operates on it.

Related

Download an HTML file so that it opens in an email client (e.g. MS Outlook)

I'm struggling to find an answer to what I thought would be a relatively straightforward problem, and wondered if anyone could help:
It is to find a way of allowing users to open downloaded HTML files in an email client such as MS Outlook (without having to save them first).
We have a Web-based application that allows users to upload files, including emails. To do this, they need to save the email onto their network, and then upload the saved file via the browser's 'file select' control. The files are saved in an Oracle database, and we have a utility that allows the user to later download the saved email. When they do so, they are given the option to 'Open' or 'Save'.
When the email was saved using the .msg format, opening the downloaded email opens that email in Outlook, and all the usual email functionality is available. However, if the email is saved in HTML, selecting 'open' always loads the email content into the browser.
Is there a way of invoking Outlook when the user opens an HTML file from the Web app, so that they don't have to either 1) always save their emails as .msg files or 2) download the email to the network and use 'open with' to open it in Outlook?
The download utility allows us to set the MIME type, but application/vnd.ms-outlook (and the various email-related types) have no effect; so that an HTML email always opens in the browser.
We have also tried changing the filename extension to '.msg', but this results in an Outlook error message and the email does not open. Removing the file extension altogether means that the file still opens in the browser.
Changing the HTM/HTML file associations so that they open with Outlook is not an option for us, I'm afraid.
Does anyone know of a solution to this? Although the problem as I've described it isn't such a big deal for our users, we were hoping to generate draft emails programmatically for users to edit and send, but without the ability to open an HTML file in Outlook, this is going to be a lot trickier than we'd hoped.
Our main network browser is still IE7, incidentally.
Many thanks for your help with this.
Outlook does not handle HTML files at all. It needs to either be MSG or EML file.
For the latter option, it is easy enough to create a dummy EML file with an HTML MIME part that represents your HTML data.
The file extension would have to be set to .msg, and the file would have to be rewritten in this format as well. You can see the technical specifications for this format here: http://msdn.microsoft.com/en-us/library/cc463912%28v=exchg.80%29.aspx

Abobe Air/Flex 4.6 Remote File Viewer

I have a Air/Flex desktop application and I'm trying to create a component within the app that can view files on the web server is is already connected to. It just needs to access one particular folder that will contain PDFs, Images & Word documents. I also want the ability to click on the files and having them open in their default desktop applications.
Is this possible and how would I go about doing this?
It's possible but not with your Flex/AIR app alone. It cannot view files/directories on server by itself but it can communicate with your server via webservices, AMF, or any other back end based service. Typically the back end reads the folder and send this information to your app. Your app can open those files in corresponding app but only if those files are available on disk so your app will have to download them prior to opening them.
Every Application has different needs but I myself usually save anything to a desktop or you can use the App storage container as well. As I use only the desktop I download what is needed OR been asked for, and the visitor has the choice of keeping it or if not needed it gets automatically deleted! this way you can use whatever PDFs, Word, Images etc. use read and write (re-write) as well as creating PDFs on the fly with Images, text etc, and that way a visitor also can print directly at his or her own leisure. regards aktell

Get access to pdf and other format file on local disk (like mediaGallery)

I'm developing a Chrome application where I want to do basic stuff with currently downloaded files(mostly I want to move them to a new location using an application or extension whichever is possible).
I'm able to get access to the image, audio, video file using the mediaGallery API of Chrome apps. Is there a possible way I can get access to and being able to move other format file from their current location to some other location using Chromium apps?
You certainly read the contents of any directory that the user has given you access to. And, once the user has done this, you can retain the entry so on subsequent executions you don't have to keep asking the user to select the directory. Then, once you have a file, you can use the file API to manipulate it.
This is in principle all the media API does, except that it comes with knowledge of some built-in media directories.

Can I facillitate "uploads" in Mobile Safari with cloud API's?

This is, perhaps, a rehash of an older SO question "A html5 web app for mobile safari to upload images from the Photos.app?". I realize that iOS Safari simply does not permit file uploads. However, I was wondering if there are ways to leverage cloud storage API's such as Dropbox or iCloud so as to accomplish the same goal. So, for example, instead of a file upload dialog I would have a url that links to dropbox/icloud that could then prompt the user for the file to send.
Sorry if I'm being too vague - but I suppose I don't care too much about the mechanism of delivery.
If you mean the url belongs to a dropbox/icloud file then you don't even need to "select" any file since the url points to one already, so a simple textbox in a form should suffice.
If this is not what you mean, can you elaborate?

How to preview other content types in titanium desktop

I am using titanium to build a desktop application. They are a couple of times I need to download an excel file (or any other content type).
I am expecting it to open a file chooser dialog so I choose a folder to save it in. Instead it displays the content of the excel file in the desktop window which is not very useful.
I am able to view PDF files correctly in the desktop window.
How do I download regular files from titanium.
I may be wrong here, but I don't think you can control this behavior. This is based on each client machine that is using your application and their specific settings. Maybe this forum will help.
It may also depend on the content headers of the source of your file. If you need a reference for how a web application can be configured to force a download, see here. While this is based on a web app, the same MIME type rules apply.