Creating a local folder through an url - windows

imagine you want to have a link on a website that creates a local folder and opens it in the Windows Explorer as soon as click on it. Something like Go to new folder
I know there is the file:-protocol, but this only opens a local folder. Is there a way to specify in the url that the browser should also create the folder.
It might be against lot's of security policies. But I'm just curious if there is any way you could achieve that. What ever come in your mind? Don't hold back.
Cheers,
Gerardo

As you mentioned, this is not allowed for web pages from internet. (imagine a rogue script running thousands of these)
You may be able to open an existing folder, in the browser (not via Windows Explorer, unless it's IE and the page is trusted).
If you want to create a folder, try using Offline Storage APIs for HTML5. This may not accomplish the 'opening in Win Explorer' part, but you can store data on user's machine.
Hope this helps.

Related

Recovering cache mozilla firefox

I have just destroyed an entire style.css file on a server. I was really tired and managed to delete the entire thing.. Now i need to recover this somehow. I have already pressed ctrl + f5 to view the changes but ofcourse i broke the entire thing.
I am using mozilla firefox and have tried using about:cache in the browser window but it only displayed the empty version of style.css.
Do you guys think i could locate the mozilla firefox cache folder and try recovering the entire folder searching for the file. But i have heard that firefox is using a security feature that doesn't name the files in original file names and extensions?
Id be grateful for any help!! Thanks
I was able to scavange the file using this software http://www.nirsoft.net/utils/mozilla_cache_viewer.html on another company pc that still had it in the cache.
But lesson of the story is have backup and do use git!! Will save you a lot of hassle.

Display PDF file in LocalState folder in Windows 8 app in Cordova

My application downloads a PDF and stores it in the LocalState folder for my Windows 8 app.
I have a link within the app that I would like to show the PDF when the user clicks it.
I've tried displaying it using ms-appdata:///local/pdfs/filename.pdf in a window.open call and I also tried using the InAppBrowser plugin within cordova with no luck. Additionally, I've tried the following:
var uri = new Windows.Foundation.Uri('ms-appdata:///local/pdfs/filename.pdf');
var file = Windows.Storage.StorageFile.getFileFromApplicationUriAsync(uri);
Windows.System.Launcher.launchFileAsync(file).done();
I know the file exists as I'm getting a file result back. Just not sure how to allow the user to view it.
By design, the local appdata folder on Windows is accessible only to that app, or to full-trust desktop applications (and this is probably true of similar sandboxed locations on other platforms). As a result, a Windows Store app that gets launched with Launcher.launchFileAsync won't be able access that location (nor can a webview process, which is also sandboxed). If a desktop application gets launched, on the other hand, it probably can access the file, but you can't tell ahead of time if that's the case. Bottom line is that local appdata isn't a good location for letting other apps get at the file.
You'll need to save the file in another location that is accessible to other apps. There are two approaches here, both of which will require a little user interaction to select a location, so they can place the PDFs anywhere they want:
Have the user select a save folder for your app, which they can do once. You would invoke the FolderPicker for this purpose, and save the selected folder in the FutureAccessList. This way you can have the user select the save folder, which grants you consent to save there, and by saving it in the FutureAccessList you can retrieve it in subsequent sessions without having to ask the user again. Refer to the File Picker Sample and the File Access Sample for more.
Have the user select a save location for each individual file, using the FilePicker (see the same sample), and you can also use the access cache to save permissions to those individual locations if you need them later.
There might be Cordova plugins that work with these APIs too, but I haven't checked. Either way, once the file is in an accessible location, launching the file should work just fine.
As an alternate solution, you could consider rendering the PDFs directly in your app. Windows has an API for this in Windows.Data.Pdf, with an associated sample. There might be a plugin or other JS libraries that could also work for this.

Is it possible to check in/out files from a webserver with a FF-plugin or Chrome extension?

I am creating a CMS and want to know if its possible to download a folder, edit things and upload it back to the server without much user interaction.
For example just press a checkout button and the files are stored on your computer. after you are finished editing these files you press the checkin button. no selecting files again and such things.
Is it possible to access the filesystem and up/download files after a user gives you the permission?
In Firefox - yes, add-ons have full access to the hard drive and can download/upload files. See for example FireFTP, also code snippets.
In Chrome - no, extensions are not allowed to access the hard drive, other than limited access via File System API (which is a virtual file system actually). Best you can do is including a binary NPAPI plugin into your extension and making it write to disk. Users will see lots of scary warnings when installing this extension.

Customizable Windows right-click file uploader?

I'm looking for a "right-click upload" application like RightLoad - an application that can upload media files to a remote FTP server from the Windows Explorer's context menu. I want to customize the application to serve as a customized image uploading tool to a PHP-based CMS.
The user would upload images and other media files to a defined FTP account (I'm also very open for other methods of transport, as long as they are supported by run-off-the-mill web hosting stacks) that they could then use in the CMS they log in to.
For me to be able to do these customizations, the application would have to be Open Source - RightLoad is "only" Freeware. Alternatively, I'm open for closed-source and commercial suggestions as long as they allow "pre-packaged" server settings that can easily be deployed to the user.
Does anybody know such a tool compatible with at least the most current versions of Windows (XP, Vista, 7)?
Bounty
Thanks all for the great input. In the case at hand, I decided it's easiest for me to stick with RightLoad and create a workflow in which the URL presented by RightLoad after the upload is copy+pasted into the CMS. I am putting a bounty on this because I think it's a worthy question for future generations, and I want to be the first one to put up a 500 bounty under the new bounty system :)
You could just use the send to menu using window's My network Places like this http://techie-buzz.com/how-to/right-click-and-send-to-ftp.html
I think WinSCP might have everything you want:
Open Source under GNU GPL
Windows Explorer's 'Send To' Context Menu
Drag 'n Drop Shell Extension
lots of additional features
and it can be scripted and is more secure than FTP due to using SSH
If you insist on open source, why not create a custom context menu handler and send it using some open source FTP client?
I would have to check the details, if it's really viable, but I would start with it.
I just had an idea, tested and working:
use regedit to edit HKEY_CLASSES_ROOT/*/Shell
add a key in shell called FTP to Mysite, in the default value set it to FTP to Mysite.
then add a key to the FTP key you just created called command, in the command default value use:
C:\Program Files (x86)\Internet Explorer\iexplore.exe http://www.mysite.com?file=%1
what this will do is open IE and the address www.mysite.com?file=C:\path\to\file.jpg
now using $_GET you can get the file address, upload it via php to where ever, even add an interface...
now when the user right clicks on any file, they can upload it via your web site by clicking FTP
1) another software is RightLoad , i use it that this moment!
2) The nice software I used over years, was FLING. It adds Right Click menu in windows explorer... However, I have left the software, because till today (version 2.35) fling DOESNT support SFTP (And nowadays on all sites I use SFTP!!)
3) I DONT like SEND-TO menu! (because I think passwords saved in WINDOWS can be easily stolen by virus..)

How to get the last current or visited Web URL in Windows?

I'm writing a Windows app. where you can create "links", it is easy to link files or folder (just use the standard dialogs for open files or browse folders), but for linking a Web URL I don't know how to get (from a Windows function or registry key) the current or last visited page.
Maybe something like the recently used files, but referencing web pages (independent of the browser), could be useful.
There is no common browser independent place to look for the last visited pages from what i know(i'm saying this from my experience at computer forensic)
I know there is a place in the registry where explorer saves this info, and probably other browsers as well, you can find this info by using a tool like procmon by sysinternals.
Just enter a site and see what the registry writes down..
This might give you a start:
wrapper class for URL history interface in C#
I found it! (at least for IE)...
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs
Then, I should find the equivalent key (or maybe a config file) of the other most common web browsers.

Resources