Paste file path into NeatUpload FileInput control - c#

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.

Related

How to access selected file path and file name from save as dialog, in code behind?

I am using some Devexpress controls that have save options which open the browser download interface with the option of choosing "save as", opening the save as dialog. I want to save to the data base the file path and file name which were chosen for future reference. How can I access them from code behind? Also if the "save" option is chosen, how can I access the file path and name which were set by the system?
Thank you.

background html CHM

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!

Populate rich Text box without openFile Dialog C#

Ive been trying for a while now to get a rich textbox to populate from a text file. Normally I would say this is easy and there are tons of solutions on here for it. My only issue is I don't want the open file dialog to populate it I want it to be populated on the onload event of the form, and populate from a known text file on the network drive here. Every solution I find seems to be asking for the users input to open the file I don't want this. This is due to the fact that when the text file is edited( which it will often be) I want the textbox to mimic this rather then have an outdated version hard coded in. Please help
If you know the location then
const string Myfile = #"c:\test\myfile.rtf";
richTextBox1.Loadfile(Myfile);
you can use UNC etc, but it may error if it cant find the file - so I would suggest file checks etc.
Use System.IO.FileSystemWatcher to watch for changes to the file, and then System.IO.File.ReadAllText to read the contents of the file into your textbox.

Open a file when it downloads with HttpContext

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

Combining URL text box with FileUpload control

I'm developing a web app which allows users to upload images. Instead of forcing them to first download an image I also want to allow them to provide a URL of the image elsewhere on the web.
I've got the code to do this, my question is how can I combine these into one text box that will allow the user to enter either the location of the image on their hard drive or the location of the image on the web.
I'm aware of the ASP File Upload control - but how could I leverage it to do this?
Let them choose like you can here at StackOverflow? (try to add an image to an answer; you get the same option).

Categories

Resources