Multiple-target cross-browser drag& drop file upload - asp.net

We're investigating if it's possible to have the following: A webpage with multiple 'folders' to which a user can drag & drop a files. It's meant to be used as an interface to upload scanned documents to an archive.
For example, we would have page that states: 'Quotes', 'Invoices' & 'Misc'. Depending on the sort of document the user would drag & drop the file from the local file system to one of these three folders. It should then upload the file to the correct folder on the web server.
Is this possible, and if it is, any existing solutions using ASP.NET?

You can use modern browsers HTML5 functionalities to do so. A detailed explanation here:
http://www.useragentman.com/blog/2010/01/10/cross-browser-html5-drag-and-drop/
There is also the jQuery plugin: https://github.com/weixiyen/jquery-filedrop This one is a bit bogus (truncates files with accents like in french, doesn't handle correctly several drop areas in the same page, ...), but are easy to fix (I sent a fixed version to the author weeks ago, but didn't get any feedback...)
With some Ajax and the correct server-side solution, it works like a charm. I don't know any .NET solution, though.
Best,

You could use a silverlight app or a java applet, but those are the only solutions that I know of... The users would obviously need to have silverlight or the jre installed.

Related

Lightbox2 from photo directory

Is it possible to use the Lightbox2 script to display all photos from a given directory instead of listing each photo in the html?
This is really just a yes or no question, but please feel free to explain. I want to know if this is possible and if I should spend my time trying to figure it out. Thanks for the help.
No, Lightbox2 is written in JavaScript.
When used on a webpage, JavaScript is a client-side scripting language.
This means that the code executes on your web browser, and only has access to data the web browser makes available to it.
For more info: Client-side scripting
You need to use a server-side language (PHP, ASP.NET, etc.) to work with the server-side directories.
Here is an answer to a similar question, with a suggestion to create an index file w/ all the image file names that you could then parse with JavaScript. I don't think it would be much more efficient than manually adding img elements though.
Is there a way to return a list of all the image file names from a folder using only Javascript?

Plone - attach multiple files

I do not have much experience with plone, I searched on other forums an answer to my problem but without success. I saw that with plone you can enter text via "Add" event, news, page, file .... is to add a file that I have encountered a problem, that I can not add more files. I need to add multiple files with a single description, there is a way to do it?
Thank you !
Supposing you are looking for a possibility to batch-upload files into a folder, there are several add-ons for help out there. I live happily with collective.quickupload, but you might want to make your own choice and have a look at the other products, too, as for example:
wildcard.foldercontents (this will be the default behaviour in Plone 5)
ATMassloader
collective.upload
collective.uploadify
PloneFlashUpload
PloneJUpload (Java)
sc.base.uploader
Also: Plone/Zope has a native FTP/WebDAV-support. You can connect to a running Plone using a Webdav client, upload files and see them loaded in the CMS.
Additionally plone.formwidget.multifile allows you to add a file-field to your contenttype, which is capable to select multiple files at once for the upload in one single file-field. Haven't seen an out-of-the-box integration into a contenttype around, though, just in case you'd like to do it :-)
Might be interesting, too in this context:
Browse-able ZIP
collective.archiveviewer

Can I control the handling of word files by the user in asp.net?

Today we have a classic asp application to manipulate the word files in the company. By using ActiveX, we can download, edit, print and finally upload the modifications without much interation.
Explaining: If I need to update anything in the "Processes.doc" file, I click on it, the ActiveX download the file to my desktop, I use it whenever I want but, when I close the file, the ActiveX uploads the new version, if this need applies with the rules.
This feature only works under IE and the users have this desire to do the same in other browsers. And the boss wants this system updated in asp.net.
My question is only "how is this possible?" How can I make it cross-plataform with the same usability that I have now? I spent the day reading about custom controls in asp.net (using object tag, but it don't work in FF), third-party components (expensive and I don't know if it will work), ActiveX written in .NET.
Any other suggestions? There is another way to this?
ActiveX is being phased out as is Flash and being replaced by JS/HTML5. These two client side technologies are more than capable of editing word documents but in the end I think you'll find that getting away from a proprietary format like MS word is the way to go. HTML is powerful enough to provide most of the same features of MS word so once the files have been converted it's simply a matter of finding a javascript HTML document editor. From there you simply need to rework the mechanism which downloads and uploads the HTML to the server to use AJAX and you'll be good to go.
Here are some examples of HTML editors:
http://www.tinymce.com/
http://speckedit.com/demo
http://nicedit.com/demos.php
http://ckeditor.com/demo

Embedding HTML Help in a QT application

I write an application, with Qt and it has a pretty big help system, which is including images, tables, links, etc... This help system is stored on a disk in a specific location as simple HTML files, together with the images and using a QWebkit control it's loaded in the application on request, and the user can browse it, etc...
Now, I would like to move away from my "in-house, file based" help solution, meaning: I want a help system which still will use my HTML files, but without the need to ship 100 files to the user, only 1 or 2.
I am aware of Qt's help system ( http://doc-snapshot.qt-project.org/4.8/qthelp-framework.html ) but I am wondering if there are any other solutions providing the same or similar functionality.
What I am looking for:
take all the HTML files and create one of them, including images
reader possibly embeddable in application, but separate application is good too.
multiplatform
support for context sensitive help (ie: "Click on what's this", help shows relevant page)
For huge help docs the best way is to use Qt Help Framework. For example QAssistant is done in this way.
It mainly consists of several html like files and index files. Then you "compile" them to get a binary(and compressed) version. You can split help in sections and so on...
I am using QWebView to display HTML help files. You get a widget and can integrate it in your application.
Qt have a good easy example here: http://qt-project.org/wiki/Open_Web_Page_in_QWebView
Since it is a widget, you can greate a stand-alone or integrated look and it it very flexible.

What's the best "file format" for saving complete web pages (images, etc.) in a single archive? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I'm working on a project which stores single images and text files in one place, like a time capsule. Now, most every project can be saved as one file, like DOC, PPT, and ODF. But complete web pages can't -- they're saved as a separate HTML file and data folder. I want to save a web page in a single archive, and while there are several solutions, there's no "standard". Which is the best format for HTML archives?
Microsoft has MHTML -- basically a file encoded exactly as a MIME HTML email message. It's already based on an existing standard, and MHTML as its own was proposed as rfc2557. This is a great idea and it's been around forever, except it's been a "proposed standard" since 1999. Plus, implementations other than IE's are just cumbersome. IE and Opera support it; Firefox and Safari with a cumbersome extension.
Mozilla has Mozilla Archive Format -- basically a ZIP file with the markup and images, with metadata saved as RDF. It's an awesome idea -- Winamp does this for skins, and ODF and OOXML for their embedded images. I love this, except, 1. Nobody else except Mozilla uses it, 2. The only extension supporting it wasn't updated since Firefox 1.5.
Data URIs are becoming more popular. Instead of referencing an external location a la MHTML or MAF, you encode the file straight into the HTML markup as base64. Depending on your view, it's streamlined since the files are right where the markup is. However, support is still somewhat weak. Firefox, Opera, and Safari support it without gaffes; IE, the market leader, only started supporting it at IE8, and even then with limits.
Then of course, there's "Save complete webpage" where the HTML markup is saved as "savedpage.html" and the files in a separate "savedpage_files" folder. Afaik, everyone does this. It's well supported. But having to handle two separate elements is not simple and streamlined at all. My project needs to have them in a single archive.
Keeping in mind browser support and ease of editing the page, what do you think's the best way to save web pages in a single archive? What would be best as a "standard"? Or should I just buckle down and deal with the HTML file and separate folder? For the sake of my project, I could support that, but I'd best avoid it.
My favourite is the ZIP format. Because:
It is very well sutied for the purpose
It is well documented
There a a lot of implementations available for creating or reading them
A user can easily extract single files, change them and put them back in the archive
Almost every major Operating System (Windows, Mac and most linux) have a ZIP program built in
The alternatives all have some flaw:
With MHTMl, you can not easily edit.
With data URI's, I don't know how difficult the implementation would be. (With ZIP, even I could do it in PHP, 3 years ago...)
The option to store things as seperate files just has far too many things that could go wrong and mess up your archive.
It is not only question of file format. Another crucial question is what exactly you want to store? Is it:
store whole page as it is with all referenced resources - images,
CSS and javascript?
to capture page as it was rendered at some point in time; a static
image of some rendered state of web page DOM?
Most current "save page as" functionality in browser, be it to MAF or MHTML or file+dir, attempts the first way. This is ultimately flawed approach.
Don't forget web pages there days are rather local applications then a static document you can easily store. Potential issues:
one page is in fact several pages build dynamically by JS, user interaction is needed
to get it to desired state
AJAX applications can do remote communication with remote service rendering it
unusable for offline view.
Hidden links in javascript code. Such resource is then not part of stored page.
Even parsing JS code may not discover them. You need to run the code.
Even position of basic html elements may be recomputed may be computed dynamically by
JS and it is not always possible/easy to recreate it locally.
You would need some sort of JS memory dump and load this to get page to desired state
you hoped to store
And many many more issues...
Check Chrome SingleFile extension. It stores a web page to one html file with images inlined using already mentioned data URIs. I haven't tested it much so I cannot say how well it handles "volatile" ajax pages.
PDFs are supported on nearly all browsers on nearly all platforms and store content and images in a single file. They can be edited with the right tools. This is almost definitely not ideal, but it's an option to consider.
Use a zip file.
You could always make a program/script that extracts the zip file to a temp directory and loads the index.html file in your browser. You could even use an index.ini/txt file to specify the file that should be loaded when extracting.
Basically, you want something like the Mozilla Archive format, but without the unnecessary rdf crap just to specify what file to load.
MHT files are good, but they usually use base64 to embed files, which will make the file size bigger than it should be (data URIs are the same way). You can add attachments as binary, but you'll have to manually do that with a hex editor or create a tool and support for it by clients might not be as good.
Of course, if you want to use what browsers generate, MHT (Opera and IE at least) might be better.
i see no excuse to use anything other than a zipfile
Well, if browser support and ease of editing are the biggest concerns I think you are stuck with the file+directory approach unless you are willing to provide an editor for the single file format and live with not very good support in browsers.
You can create a single file by compressing the contents. You can also create a parent directory to ease handling.
The problem is that html is bottoms up not top down. Look at your file name which saved on my box as "What's the best "file format" for saving complete web pages (images, etc.) in a single archive? - Stack Overflow.html"
Just add a '|' and one has trouble doing copy and paste backups to a spare drive. In the end you end up. chopping the file name in order to save it. Dozens/ perhaps hundreds of identical index.html or index.php are cluttering my drives.
The partial solution is to write you own CMS and use scripts to map all relevant files to a flat file database - then use fileName, size, mtime and md5 to get a unique Id for each file. Create a flat file index permitting 100k or 1000k records. The goal is to write once and use many times. So you need a real CMS you need a unique id based on content (eg index8765432.html) that goes in your files_archive. Ditto for the others. Then you can non-destructively symlink from the saved original html to the files_archive and just recreate the file using a php or alternative script if need be. Don't know if it will work as I'm at the same point you're at - maybe in a week will know for sure. The more useful approach is to have a top down structure based on your business or personal wants and related tasks. So your files might be organized top down but external ones bottom up to preserve the original content. My interest is in Web 3.0 services and the closer you get to machine to machine interaction the greater the need to structure the information. Maybe time to rethink the idea of bundling everything into a single file. So you have hundreds of main.css why bundle when a top down solution might let you modify one file instead of hundreds.

Resources