IE file download box get location - file

i am currently working on a issue where i need to get location of the file downloaded.First let me explain the scenario.
I placed a link in my page and when user clicks the link it shows file download dialog with open/save/cancel options in IE.Now when the user clicks on the save button and choose a location to save the file i need to get that file saved location using whatever options possible.
Thanks!

I do not think you can... at least not easy. This runs on the client, and for security reasons you can not acces the client's filesystem with javascript.
Maybe it is however possible using a flash or silverlight plugin, as the user can allow access from within these applications to the local filesystem. It might be very difficult tho...

The browser will not allow you to access information about the clients filesystem.

Related

Invoke File save as prompt while Downloading in ExtJS

I want to invoke the file save as prompt while allowing the user to download a file in ExtJS from a URL.
Basically the idea is to allow the user to change the file name and select his desired location before saving the file on their machine.
Is there any way I could do this?
I do not want to use:
A server side code to send the headers.
Nor do I want to use the Flash-based Downloadify library to do this.
Also, <a> tag's "download" attribute does download the file, but it does not prompt the dialog box if the browser settings are not set right.
Is there any way apart from the above where we could handle the file download in our application?
No, it cannot be done with javascript alone due to the security restrictions of the contemporary browsers. You can read files but I have no knowledge of a way to save files directly from the javascript alone.
If your "I do not want tos" are not that strict, here you can find an example of file downloading. The essence is to send "Content-Disposition: attachment" header.

download file which redirects?

I've tried to search for this both on Google and StackOverFlow, but simply can't find what I'm looking for, it might be that it's simply not possible, but thought I would ask anyway.
I'm looking for a way to make a file redirect the user to another page, the user would download the file by clicking on a button.
It's for a Prestashop downloadable product, I'm trying to redirect the user to another part of our site (which isn't directly visible) to be able to view magazines, etc. in a viewer.
Now Prestashop is natively set up to download the file, which is what we don't want, hence the use of the viewer, but there is no way to simply provide a link to send the user to instead of a physical file, like a PDF or something. I can't really modify the button as its generated by Prestashop, and if I add a PDF file with the link in there it defeats te purpose as I dont want people having the link in a document (I know they can find it from their history and so on). Hence I thought it would be easier to do it with a document that redirects if possible.
So in short, is it possible to make a file that would send people to a certain web page once they open/download this file on/to their computer?
And if yes, how would one go about it?
Can you make the user download an HTML file? If so, you can use "meta refresh" to redirect the user to your private page.
This does mean the unprotected link will be visible in downloaded HTML file - perhaps you can obfuscate this with JavaScript to make it a little more difficult for users to find your protected URL.
http://www.w3.org/TR/WCAG20-TECHS/H76

different way to upload file

Is there a way to upload a file by copying a file from the desktop and pasting it into a text input which will obviously just display the filename, rather than going through the file window and selecting the file?
Talking about web applications, that could be possible if you install a custom ActiveX object or even a Java applet, or maybe trying to exploit a browser vulnerability. But, most straight way to do that will be using a <input type='file'>
For client applications, you can do that, if your current user have appropriate permissions, like accessing your file system and accessing your web server through HTTP.
Anyways, you must provide more details to get more concrete answers.
I think this is not possible and should not be possible as this is a security issue. Consider the following scenario:
A malicious site example.com shows you a harmless looking form where they have hidden such a file upload textfield with the already inserted value '/etc/passwd'. They have used either a hidden_field or just display:none with CSS.
You fill in the form and submit without knowing you have also sent a file.

store image in a folder form a list in silverlight

I want to store a image in to a folder which I have selected from a list in silverlight
In Silverlight you have only limited access to the file system for security reason.
So everything what you want to save would end up in IsolatedStorage...
Check out this Quickstart Video and let me know if it helps
http://www.silverlight.net/learn/quickstarts/isolatedstorage/
In Silverlight, You have limited access to the client file system. If you are running Out Of Browser application with elevated permission, you can access User folders (My documents in windows).
But you can try some workarounds like using JavaScript u can try to download file. For reference Download a picture OnClick

What is the best way to let users upload pictures to my WPF application

I have a WPF intranet app running in Trusted mode (local only).
I would like the users to be able to upload an image and attach it to an article on my newsletters section. I am having trouble deciding where these images will be stored.
Please provide me with your opinions.
At present I have a few ideas myself;
I could have an aspx page that runs parallel to this app, and run this inside a browser(I-frame). This page could then handle the upload and display of the image.
I could also, have the users copy directly to a network share.
It seems that there should be a more elegant sollution that I am not aware of.
Any ideas?
Don't force the solution towards ASPX just because you know how to do it there. It's unnatural to build a page, host browser to show that page etc, just so you could upload an image.
It's actually quite simpler to do it in a desktop client than on web page. You have a "Load File Dialog" - use that to get to the filepath the user wants to upload, and when you have that you can either:
copy it (inside your application) to your share,
or if you have a service - send it through some method call,
or you can even store it inside a database (recommended if the files are small)
There's really lots of options here... it depends if your client has connection to db, do you have service in between, etc...

Resources