I have a handler that I call when a link gets clicked. This handler gets the file contents from the DB and writes the contents to context.Response. I'd like to open this file as well along with it getting downloaded. Is this possible?
You have no control over browser's behavior. It will either open in browser OR display open/save dialog.
You may try to render custom page with HTML view of the file and automatically trigger second download from that HTML page to force open/save dialog.
no. it is not.
if its a bitmap file - then maybe becuase it doesnt have to be fully downloaded...
but forget about it.
it is not the right way.
you cant open a file while it is being downloaded - its a filesystem - restriction
Related
In downloading any PDF Files, we need to click on save as popup window in IE and saving it into a folder.
Now, as an automation project, I want that save as popup window should be automatically clicked and it should save the files in the provided folder.
Kindly help us in C# code.
Many thanks.
I don't know if you can set it through code because its all about browser settings also I don't find any option in IE. However in Google Chrome you can customize your downloads using its setting. Please ask the users of your application to start using Chrome (if possible) and change its downloads setting as per the screen shot given below:
Using the NeatUpload file-upload control
Is there a way I can paste a file path (instead of browsing) into an InputFile control?
Say I have the path on the clipboard and javascript sets focus to the control, and the user manually pastes the clipboard contents using ctrl+v.
Right now, if I paste the clipboard, it doesn't seem to receive the file. That is, the textual path does not seem to get accepted into the control.
Now, I've found these thread:
Assign file path to FileUpload Control
and
How can I set path in the fileupload control on page load
, but I thought maybe since NeatUpload has such influence over the control that there was another way - say, if the user pasted the file-path into a text box, then I could have the file-path available to code-behind. Then, how would I get that path into the InputFile control? I've read the NeatUpload docs and searched the forums, but I still need some advice or examples.
Is there a way to be able to receive a paste event into the InputFile control? Or, is there a way to get the path from a textbox into the upload sequence code?
Due to security reasons, there is no way to set any of the settings for this type of control.
However, a workaround is this:
Add a javascript (A simple $('InputFileID').click(); will do nicely) function that will click the Browse button. This will open the file-browsing dialogue. Now the user can paste the clipboard right into the box in that dialogue.
I finished the help of my system in html with 'html workshop'
I'm having a problem with the background of the pages.
I am using a background image in my html pages and in editor works correctly but when I compile the chm with html workshop, all styles in html pages see but the background disappear and set into blank.
can I change the background in pages on chm or not?
thanks
You need to explicitly include your background image in compiled CHM. If an image is referenced with <img> tag, HHW will include it automatically. But if you use an image with CSS, you need to do it yourself:
In HHW, go to Project tab and press Add/Remove topic files button.
Press Add... button.
Type * in the File name field so that you can see all files, including images.
Select your background image file.
Save the project and compile. The background should be visible now.
Tip. If you have many images to include, you can use wildcards. Close HHW and open .hhp file in a text editor. Find the [FILES] section and add something like:
MyImagesFolder\*.jpg
Upload your image somewhere and set the URL as the source, seems easier.
Create a Google Drive, SkyDrive, Dropbox account and leave it there!
This is what I have done:
I have loaded a pdf file in web browser,
Now I want to select text from that file and paste into a text box.
Can anyone help me?
I'm pretty sure that this is going to be prohibitively difficult, if not impossible, to do.
The browser does not 'run' the PDF, it acts as a host for the PDF application, which ends up sharing it's main window. After that, control of the cursor etc passes to the PDF application and the browser is effectively no longer aware of what happens inside it. If the PDF application being used exposes COM interfaces for manipulating the cursor/text selection (doubtful), then it's possible to script against those interfaces from client script - but you won't be able to actually run any script in that window because the browser is showing a PDF, not a web page.
It might be possible if you hosted the web control on a windows forms application, but even so I wouldn't even know where to start on that one.
If your goal is to extract text from the PDF then you're probably better off pushing it through a .Net PDF library. A quick google on that one will yield you some suitable libraries.
if your pdf file has form elements then the file can be submitted to a url.
check this link.. it might help.
Can a PDF fillable form post itself to an HTTPS URL?
i am using a iframe in my web page. I want to open a file c:\Dir\SubDir\xyz.doc inside a iframe.How to do this ? I checked out many sources ,all of them specified to give the source of the iframe to the path by adding the code.Its not working for me. Here is my code
iframe1.attributes["src"] ="c:\\Dir\SubDir\xyz.doc"
assuming you want to open a file on the client's computer, you would need to use a file URL, such as "file://c|/Dir/SubDir/xyz.doc". that said, it still may not work correctly for various reasons (probably primarily security-related).
if my assumption is wrong and you want to display a file on the server, you still need to use a URL and not a file path, meaning you'd have to have the file somewhere under the document root: "../Dir/SubDir/xyz.doc" for example.
then there is the strong likelihood that a .doc file will not render correctly on a webpage.
<iframe src="test.doc"></iframe>
above example is working in my environment, cause I put file inside my project folder and access that file from there..
you can not open any file out side of your project folder.... So please keep this in mind.
#jcomeau_ictx is right you cannot open .doc file in browser but yes it will ask you to save file, if you put in iframe..