how to set fileupload dialog box to specified image folder path - asp.net

is that possible to set the file open dialog to images folder specified path so when user select the fileupload it directly show the images and only specified extension and sizes images are shown in it
how can i validate it

No it is not possible and if you want to check the file size and format then check/ validate at the time of upload if not validate then generate error from code side.

It is possible in window application but it is not possible in asp.net application.
Explanation: As what ever you path will set(if possible) will be different to all the client.

Related

Set value of a file input in JavaFX web view via java

I have a WebView node in my JavaFX and the page loaded in it has a <input type=file>. I want to set this input's value to a file on disk. I know this is not possible by injecting javascript into the web view. But I'm wondering if I can get access to JavaFX internals in how these input fields are handled and set the value through there. There appears to be no mention of file input controls' handling in the docs so I'm lost on this.
When I click on the file input. JavaFX gives me a native file selector. So, I'm expecting there's some form of handler that is invoked when clicking on a file input, that asks the user to select a file and then fills the file input with this value. That's what I want to do.
I tried just getting the element and setting it's value, but of course, it didn't work.
webEngine.getDocument().getElementById("FileInput")
.setNodeValue("C:\\attachment.pdf");
This piece of code does nothing. No error, no result either.
So, any ideas?
JavaFX internally uses WebKit for the WebView node, thus it have the same security restrictions. It's not possible to set the value of <input type="file"/> programmatically, neither over JavaScript or Java.
I suggest you to use FileChooser without using the WebView node. What the WebView node shows is a select button, which calls a FileChooser, and a label with the selected file name. This can be easily implemented in Java source code using JavaFX.

Displaying Image dynamically in the asp.net webpage

I want to display images in my website developed in asp.net(web form) dynamically. Like I have created a a page in admin section where I am uploading the image and the uploded image save in the folder and its path save in the database. Now uploading and edit on image is done by me. I want to display in my page in which I want to 4 images in a row. So what will be the control i need to use. or is there any other idea i can go for creating this task.
I am thanking you so for you ideas
You can use DataList or DataRepeater or any data control to Display Image. Its depend on requirement.
If you want show images on client side then use DataRepeater.
For display images in Datalist :
http://www.dotnetfox.com/articles/how-to-display-images-in-datalist-control-using-Asp-Net-with-C-Sharp-1037.aspx
Display images in Repeater :
http://ravisatyadarshi.wordpress.com/2012/11/17/how-to-display-an-image-gallery-using-repeater-in-asp-net/
You can use image control..
like,
e.g.-
Image1.ImageUrl = "~/uploads/"+imgstr+"";
here imgstr i variable in which you are getting image path from db

Image in Page property in CQ5

I have set an image of type .jpg in image tab of page property. How can I fetch or access this image in the component JSP.
Thanks
Not being able to see what you have implemented I'm assuming this will save some properties to the page level based around the image such as its source.
This means you can then pull that out using
currentPage.getProperties().get("property","default");

how to display image in a grid view or data list?

I've uploaded some data and images into the database. I want to retrive them by search button and show the searched values in DataList.
database
anil image
anil k image
kishore image
And the WebPage looks like this:
textbox[search button]
If Users enters anil in the search box the correspondent name and image should be displayed in DataList.
How can I get the data from database and build a DataList from it using asp.net and sql?
If you had a link to click that would open a new window to show the image, you could just return the image directly by changing the page response to stream the image bytes (and change the content type of the response appropriately). Since you need to display the image within the grid, the only way I can think of doing this (since you can't change the response of the request) is to request all of the files, save it temporarily on the server, and set an image link to the downloaded file.
this is webforms 101. there are numerous examples online. the "advanced" part is displaying images from a database. but again there are a number of examples on the web about displaying images stored in a database.

opening file upload window using javascript

I have a button or link button. I want to open a window for file uploading by clicking the button or link button. Actually at that time I won't have any file upload control there.
can any one tell me how to do it by using JavaScript?
<button onclick="window.open('the_page_containing_the_upload_form.html', 'Upload form')">Upload</button>
I think you are asking that you want to open up the file upload dialog with a click of something other than the input element itself.
You can not just open up the file upload dialog since that is sort of a thing we call a security issue. You can style the input field to make it look like something else

Resources