Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - FileUpload control.

 
Thread Tools Search this Thread
Old 12-26-2005, 07:38 PM   #1
Default FileUpload control.


I'm using the fileuploadcontrol for the user to select a file, in this case
a image file.
I would like to see the little preview image to be shown right after
selection, but there seems to be no event from the fileupload control.
To by-pass this I let the user click on a linkbutton to show the preview,
but when the page comes back after the postback, the fileuploadcontrol is
empty again.

Is there an update to this control, giving more events?
Is there a third party control, better then the one shipped with vs2005?
Is there a way to create these events for the fileuploadcontrol?

rg,
Eric




Eric
  Reply With Quote
Old 12-27-2005, 03:06 AM   #2
intrader
 
Posts: n/a
Default Re: FileUpload control.
On Mon, 26 Dec 2005 20:38:28 +0100, Eric wrote:

> I'm using the fileuploadcontrol for the user to select a file, in this case
> a image file.
> I would like to see the little preview image to be shown right after
> selection, but there seems to be no event from the fileupload control.
> To by-pass this I let the user click on a linkbutton to show the preview,
> but when the page comes back after the postback, the fileuploadcontrol is
> empty again.
>
> Is there an update to this control, giving more events?
> Is there a third party control, better then the one shipped with vs2005?
> Is there a way to create these events for the fileuploadcontrol?
>
> rg,
> Eric

Once the file is at the server, you can have the server render an
image to the client in thumbnail size width/height.



intrader
  Reply With Quote
Old 12-27-2005, 08:44 AM   #3
ray.bradbury9@gmail.com
 
Posts: n/a
Default Re: FileUpload control.
First of all, excuse my poor english.

I don't think that is possible, let me explain why. Through Javascript
you cannot access the local filesystem, perhaps setting the IE security
to lowest, but I don't think it could work. As intrader has noticed,
that can be accomplished once the file is in the web server, it is the
best way.

The following code does NOT work.

<script type="text/javascript" language="javascript">
function cargarImagenServer(){
Imagen.src=fileUploader1.value;
}
</script>
<img id="Imagen" alt="Imagen A mostrar" src="" />
<asp:FileUpload runat="server" onclick="cargarImagenServer();"
ID="fileUploader1" />



ray.bradbury9@gmail.com
  Reply With Quote
Old 08-04-2009, 05:34 PM   #4
PalehorseX
Junior Member
 
Join Date: Aug 2009
Posts: 1
Default
This works for me:

HTML Code:
<script type="text/javascript"> function previewImg(path, img) { imgPrev = document.images[img]; imgPrev.src = path; } </script>
HTML Code:
<asp:FileUpload runat="server" ID="uploadImage" onchange="previewImg(this.value, 'imgPreview');" /> <br /> <asp:Image ID="imgPreview" name="imgPreviewModify" runat="server" />


PalehorseX
PalehorseX is offline   Reply With Quote
Old 11-03-2009, 11:45 AM   #5
Ankho
Junior Member
 
Join Date: Nov 2009
Posts: 1
Default Not Working
Hello,

It's not working with me can anyone plz help...
The src of the image is changing but the page isnt refreshing so that the image can load again with the other src...

Thank you,

Anthony


Ankho
Ankho is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mind Control and CIA'S BOURNE IDENTITY PLOT soleilmavis@gmail.com DVD Video 2 08-03-2007 09:54 PM
FileUpload Web Control is not working with Atlas rajesh20k Software 0 02-20-2007 03:55 PM
Ajax Atlas not working in User Control faiq Software 0 09-16-2006 08:28 AM
Charter Communications -- mind control Laura DVD Video 0 01-28-2006 03:14 AM
FS: JP1 cable to program your universial remote control, now youcan control anything you want! Mike DVD Video 0 07-15-2005 02:46 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46