Multiple file selection - javascript

I'm playing with FileDrop library, to allow users to upload multiple files "one-shot" with IE11.
As documented, setting this property
zone.multiple(true);
is possible to select multiple files to be uploaded.
I noticed this strange behaviour.
If I download the sample package, setting the multiple property into filedrop.js and run it locally (open basic.html file whith IE) everything works fine.
If I put the same HTML code into an HTML form in Lotus Domino, multiple selection doesn't work.
I repeat, it only happens with IE, using other browser everything is ok.
Which could be the problem? Any workaround to make it works?
UPDATE:
Note that this page, with IE, works fine, and multiple selection is allowed.

The trick is to add
<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">
into <head> section of the form

Related

getElementById returning null when trying to build Chrome Extension

I'm trying to build a chrome extension which allows you to play an mp3 file (pre-selected) by clicking a button- very simple for now I know! However, when I am trying to access the button in my js file my function only returns null. I have moved the script tag to the end of my body and included a 'DOMContentLoaded' event listener, as shown below, but I still can't shake this error- and this is after trying to incorporate practically every suggestion I've found on other similar questions! Any help greatly appreciated.
my javascript
my html file
I should note I ran this code through another IDE (the one provided by the CS50x course) and everything worked fine.

A hyperlink download attribute not working

so i have this problem with hyperlink attribute download. basically i have link that download a certain file. however it doesnt work..
download file
With this format, it will download the file but it will give me an failed file says 'no file'.
On the other hand if i have link that has a complete uri format:
download file
It redirects me to the page and it will just show the file. The weird
thing is when I tried it on mozilla and brave browser. it works. but
in safari, and my default is google chrome. its not working..
Am I missing something? maybe in my header? really appreciate if you can help.. thanks!
EDITED
also, i've read this stuff about content disposition, so how do i know that my webpage set as inline for that matter.
it turns out, my problem is conflicted by same origin urls. Apprently, I am rquesting from different hosts/site, for further explanation see : https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy
If you look at here https://www.w3schools.com/TagS/tag_a.asp
Scroll down to attributes, and you will see that the DOWNLOAD attribute is only supported by HTML5, which, as it seems, your friend's version of Safari does not support. I recommend updating the program.
Alternatively, you can right-click on the download link, then click Save As..., then download it that way.
This may also be caused js intercepting navigation and redirecting. If so, you may be able to work around it by adding a target attribute.
download file.txt

CKeditor Preview Plugin.js, editing for Chrome and IE. As it refuses CSS style

I am integrating WYSIWYG editor for a fairly simple CMS. I have chosen CKeditor and use the 'preview' button. This thing is that it is inconsistent in the three main browsers. (IE, Chrome and Firefox).
If you have ever used CKeditor you will know within the files that come with it there are two locations to find 'preview.html'. These being:
http://sitename/ckeditor/plugins/preview
and
http://sitename/ckeditor/_source/plugins/preview
The latter also contains a plugin.js file that relates to the preview plugin, and where I feel the answer to my question lies. This code can be found here:
http://jsfiddle.net/keKLP/
Just so that you can see it. Now the problem is that the preview by default is just plain text. So I edited the preview.html pages and wrapped the bit of code that pulls the content from the editor in HTML including style sheet references and images paths. In firefox this works fine, but only in Firefox. In chrome and IE it pulls through no style, no images, nothing. When I looked into it I noticed that the Firefox preview opens up a new window that points to an actual address. The address being:
http://mysite.co.uk/ckeditor/plugins/preview/preview.html
where as IE and Chrome open a new window/tab pointing to:
about:blank
Having looked through that JavaScript file (plugin.js) listed above, I can see it does something different for Firefox than other browsers. I have changed almost everything that say 'path' or 'URL' in the file trying to get it to point to the same place as Firefox in other browsers instead of about:blank.
However I am no JavaScript expert and I feel my understanding of the exact problem is lacking. It's driving me crazy, can anyone point me to a bit of JavaScript in that file I should be looking at, or shed some light on the problem? ANY help is greatly appreciated.
There is a possible way for tracing through the preview plugins .js file and trying to edit the way it calls the preview pop-up. However this is long winded and problematic, as it always seems to work better in firefox than any other browser.
My solution to this was to remove ckeditor and implment TinyMCE. The preview page is alot easier to edit and caused no problems at all.
I resolved that issue adding my own custom files (css, js, meta, etc.) into ckeditor.js. I created a string variable containing html code (with link, meta, scripts) like this:
var my_includefiles='<link href="http://assets.mydomain.com/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" /><link href="http://assets.mydomain.com/css/mainstyle.css" rel="stylesheet" type="text/css" charset="utf-8"/><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>';
And I just added my var to this portion of code (part of _cke_htmlToLoad):
a=a.config.docType+'<html dir="'+a.config.contentsLangDirection+'"><head>'+e+CKEDITOR.tools.buildStyleHtml(a.config.contentsCss)+my_includefiles+"<title>"+a.lang.preview.preview+"</title></head>"+(b+">")+a.getData()+"</body></html>"
After that, preview with my own custom styles and behaviors worked fine in IE9, FF19, Opera12 but not in Chrome (25), so to make it work in Chrome I removed this portion of code of ckeditor.js
CKEDITOR.env.webkit&&setTimeout(function(){f.body.innerHTML=f.body.innerHTML+""},0)
That resolved the problem. I hope it help.

Forced Image download - file extension missing

I got an AJAX function that loads a png from a canvas graph element and does (per user choice) open the image in a new browser window or force a download.
While the first works without a problem, I got a problem with adding the file extension to the download. Currently I simply get none, using the following HttpHeaders: image/octet-stream, application/download(force-download, x-download)
Gladly some SO user put a JsFiddle together. 1)
Question: How could I go and append a file extension (.png/.jpeg) to the forced download as seen in the JsFiddle example?
1) Sry, but I donĀ“t know the User name anymore.
Unfortunately, with data uris, it is not possible to supply filenames. You should probably look at the HTML5 BlobBuilder API - http://blogs.msdn.com/b/ie/archive/2012/01/27/creating-files-through-blobbuilder.aspx
Even with BlobBuilder, I've found that only Chrome acknowledges the filenames you supply, not Firefox.

HTML5 Drag and Drop styles not displaying on Windows Server 2003

I'm working on a file upload utility based on Valum's Ajax-Uploader. The idea is similar to the Gmail attachment process. The user should be able to drag a file from the desktop into the browser window and onto the file upload area to get it to upload. This works fine in the browsers that support this functionality (Firefox 3.6+, Chrome 7+).
The problem I'm running into are the styles that should be re-drawn when the user:
Drags the file anywhere in the browser
Drags the file into the upload area
I have tested in the exact same browser versions on WinXP, Vista, and Win7. The appropriate styles are redrawn. However, in Windows Server 2003, they do not.
In Win2003, when I inspect the div that should be redrawn via Firebug, the "drop-area" and "drop-area-active" classes are applied correctly. Firebug even shows the correct style declarations, but the changes are never visible.
The only difference between FF and Chrome that I'm able to spot is that in Chrome, the "drop-area-active" style is displayed for a split second when the user drops the file.
I'm not positive that it is a Windows2003 issue, but that's the only OS in which I'm able to recreate the bug.
Edit:
If you're running Win2k3, try the Gmail drag'n'drop functionality. I can see the alternate styles in other OS's, but not Win2k3.
Edit #2:
Still seeing this issue in many different places. Anyone have any suggestions? I have submitted this as a bug to the Chromium Project. Issue 68632.
http://code.google.com/p/chromium/issues/detail?id=68632

Categories

Resources