[jQuery] Re: Jquery can show Images from file:///C:?
Hi Andy I really wish but I am not JQuery Ninja, yet. ; ) Mario 2007/8/17, Andy Matthews [EMAIL PROTECTED]: Yeah...would be nice if someone took something like that and converted it to a plugin. Mario? YOu up for it? :) -- *From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Mario Moura *Sent:* Friday, August 17, 2007 2:58 PM *To:* jquery-en@googlegroups.com *Subject:* [jQuery] Re: Jquery can show Images from file:///C:? Hi Wow. Looks great. ASAP I will study this I saw that fileExtension is caseSensitive so probably should have fileExtension == JPG fileExtension == jpg fileExtension == Jpg to avoid trouble. thanks a lot Andy for share this Regards Mario 2007/8/17, Joan Piedra [EMAIL PROTECTED]: Hello Andy, It looks interesting, I've tried this before but I had some difficulties with Firefox, at last I could do it with IE6, IE7, and Firefox. But Safari and Opera mask the whole url in the input file. So this won't work in those browsers. Regards, On 8/17/07, Andy Matthews [EMAIL PROTECTED] wrote: That's not true at all. I've got a JS file that allows for live previews. The JS file is attached, and here's the code needed to trigger it: form name=myForm input type=file name=photo_filebr input type=button name=button class=smaller value=Preview Image onclick=previewImage(document.myForm.photo_file.value) /form I can't say that it works on all computers, but I've never once had a client say that it didn't work. -- *From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Joan Piedra *Sent:* Friday, August 17, 2007 12:39 PM *To:* jquery-en@googlegroups.com *Subject:* [jQuery] Re: Jquery can show Images from file:///C:? Hey Mario, I had the same idea some time ago, but after trying some workarounds and reading a lot of browser docs I noticed this was an horrible and really bad practice in web development. So we actually can't make an image preview before sending data to the server. We will have to stick to the simple way, upload then preview. Cheers, On 8/7/07, Mario Moura [EMAIL PROTECTED] wrote: Hi folks What I am trying is show an image into my browser with this tag img width=50 height=50 src=file:///C:/Users/example.JPG/ into my browser. Is it possible? or is a security lock from browsers? I am using $.post() So I could send the path that user choice C:/Users/example.JPG to my php and return img width=50 height=50 src=file:///C:/Users/example.JPG/ But isnt working because browsers cant show this tag img width=50 height=50 src=file:///C:/Users/example.JPG/ I can upload the file to webserver I know but will be more fast and I can save some bandwidth traffic if I could do this. And avoid malicious users consume my bandwidth traffic. So I am trying use AJAX to simulate Upload Ajax? and when forms is already send images normaly (without ajax). So Jquery can show Images from file:///C:? or something like this? Regards Mario -- Joan Piedra || Frontend webdeveloper http://joanpiedra.com/ -- Joan Piedra || Frontend webdeveloper http://joanpiedra.com/ -- Mário Alberto Chaves Moura [EMAIL PROTECTED] 31-9157-6000 -- Mário Alberto Chaves Moura [EMAIL PROTECTED] 31-9157-6000
[jQuery] Re: Jquery can show Images from file:///C:?
Hey Mario, I had the same idea some time ago, but after trying some workarounds and reading a lot of browser docs I noticed this was an horrible and really bad practice in web development. So we actually can't make an image preview before sending data to the server. We will have to stick to the simple way, upload then preview. Cheers, On 8/7/07, Mario Moura [EMAIL PROTECTED] wrote: Hi folks What I am trying is show an image into my browser with this tag img width=50 height=50 src=file:///C:/Users/example.JPG/ into my browser. Is it possible? or is a security lock from browsers? I am using $.post() So I could send the path that user choice C:/Users/example.JPG to my php and return img width=50 height=50 src=file:///C:/Users/example.JPG/ But isnt working because browsers cant show this tag img width=50 height=50 src=file:///C:/Users/example.JPG/ I can upload the file to webserver I know but will be more fast and I can save some bandwidth traffic if I could do this. And avoid malicious users consume my bandwidth traffic. So I am trying use AJAX to simulate Upload Ajax? and when forms is already send images normaly (without ajax). So Jquery can show Images from file:///C:? or something like this? Regards Mario -- Joan Piedra || Frontend webdeveloper http://joanpiedra.com/
[jQuery] Re: Jquery can show Images from file:///C:?
That's not true at all. I've got a JS file that allows for live previews. The JS file is attached, and here's the code needed to trigger it: form name=myForm input type=file name=photo_filebr input type=button name=button class=smaller value=Preview Image onclick=previewImage(document.myForm.photo_file.value) /form I can't say that it works on all computers, but I've never once had a client say that it didn't work. _ From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Joan Piedra Sent: Friday, August 17, 2007 12:39 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Jquery can show Images from file:///C:? Hey Mario, I had the same idea some time ago, but after trying some workarounds and reading a lot of browser docs I noticed this was an horrible and really bad practice in web development. So we actually can't make an image preview before sending data to the server. We will have to stick to the simple way, upload then preview. Cheers, On 8/7/07, Mario Moura mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi folks What I am trying is show an image into my browser with this tag img width=50 height=50 src=file:///C:/Users/example.JPG/ into my browser. Is it possible? or is a security lock from browsers? I am using $.post() So I could send the path that user choice C:/Users/example.JPG to my php and return img width=50 height=50 src=file:///C:/Users/example.JPG/ But isnt working because browsers cant show this tag img width=50 height=50 src=file:///C:/Users/example.JPG/ I can upload the file to webserver I know but will be more fast and I can save some bandwidth traffic if I could do this. And avoid malicious users consume my bandwidth traffic. So I am trying use AJAX to simulate Upload Ajax? and when forms is already send images normaly (without ajax). So Jquery can show Images from file:///C:? or something like this? Regards Mario -- Joan Piedra || Frontend webdeveloper http://joanpiedra.com/ previewImage.js Description: application/js
[jQuery] Re: Jquery can show Images from file:///C:?
Hello Andy, It looks interesting, I've tried this before but I had some difficulties with Firefox, at last I could do it with IE6, IE7, and Firefox. But Safari and Opera mask the whole url in the input file. So this won't work in those browsers. Regards, On 8/17/07, Andy Matthews [EMAIL PROTECTED] wrote: That's not true at all. I've got a JS file that allows for live previews. The JS file is attached, and here's the code needed to trigger it: form name=myForm input type=file name=photo_filebr input type=button name=button class=smaller value=Preview Image onclick=previewImage(document.myForm.photo_file.value) /form I can't say that it works on all computers, but I've never once had a client say that it didn't work. -- *From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Joan Piedra *Sent:* Friday, August 17, 2007 12:39 PM *To:* jquery-en@googlegroups.com *Subject:* [jQuery] Re: Jquery can show Images from file:///C:? Hey Mario, I had the same idea some time ago, but after trying some workarounds and reading a lot of browser docs I noticed this was an horrible and really bad practice in web development. So we actually can't make an image preview before sending data to the server. We will have to stick to the simple way, upload then preview. Cheers, On 8/7/07, Mario Moura [EMAIL PROTECTED] wrote: Hi folks What I am trying is show an image into my browser with this tag img width=50 height=50 src=file:///C:/Users/example.JPG/ into my browser. Is it possible? or is a security lock from browsers? I am using $.post() So I could send the path that user choice C:/Users/example.JPG to my php and return img width=50 height=50 src=file:///C:/Users/example.JPG/ But isnt working because browsers cant show this tag img width=50 height=50 src=file:///C:/Users/example.JPG/ I can upload the file to webserver I know but will be more fast and I can save some bandwidth traffic if I could do this. And avoid malicious users consume my bandwidth traffic. So I am trying use AJAX to simulate Upload Ajax? and when forms is already send images normaly (without ajax). So Jquery can show Images from file:///C:? or something like this? Regards Mario -- Joan Piedra || Frontend webdeveloper http://joanpiedra.com/ -- Joan Piedra || Frontend webdeveloper http://joanpiedra.com/
[jQuery] Re: Jquery can show Images from file:///C:?
Hi Wow. Looks great. ASAP I will study this I saw that fileExtension is caseSensitive so probably should have fileExtension == JPG fileExtension == jpg fileExtension == Jpg to avoid trouble. thanks a lot Andy for share this Regards Mario 2007/8/17, Joan Piedra [EMAIL PROTECTED]: Hello Andy, It looks interesting, I've tried this before but I had some difficulties with Firefox, at last I could do it with IE6, IE7, and Firefox. But Safari and Opera mask the whole url in the input file. So this won't work in those browsers. Regards, On 8/17/07, Andy Matthews [EMAIL PROTECTED] wrote: That's not true at all. I've got a JS file that allows for live previews. The JS file is attached, and here's the code needed to trigger it: form name=myForm input type=file name=photo_filebr input type=button name=button class=smaller value=Preview Image onclick=previewImage(document.myForm.photo_file.value) /form I can't say that it works on all computers, but I've never once had a client say that it didn't work. -- *From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Joan Piedra *Sent:* Friday, August 17, 2007 12:39 PM *To:* jquery-en@googlegroups.com *Subject:* [jQuery] Re: Jquery can show Images from file:///C:? Hey Mario, I had the same idea some time ago, but after trying some workarounds and reading a lot of browser docs I noticed this was an horrible and really bad practice in web development. So we actually can't make an image preview before sending data to the server. We will have to stick to the simple way, upload then preview. Cheers, On 8/7/07, Mario Moura [EMAIL PROTECTED] wrote: Hi folks What I am trying is show an image into my browser with this tag img width=50 height=50 src=file:///C:/Users/example.JPG/ into my browser. Is it possible? or is a security lock from browsers? I am using $.post() So I could send the path that user choice C:/Users/example.JPG to my php and return img width=50 height=50 src=file:///C:/Users/example.JPG/ But isnt working because browsers cant show this tag img width=50 height=50 src=file:///C:/Users/example.JPG/ I can upload the file to webserver I know but will be more fast and I can save some bandwidth traffic if I could do this. And avoid malicious users consume my bandwidth traffic. So I am trying use AJAX to simulate Upload Ajax? and when forms is already send images normaly (without ajax). So Jquery can show Images from file:///C:? or something like this? Regards Mario -- Joan Piedra || Frontend webdeveloper http://joanpiedra.com/ -- Joan Piedra || Frontend webdeveloper http://joanpiedra.com/ -- Mário Alberto Chaves Moura [EMAIL PROTECTED] 31-9157-6000
[jQuery] Re: Jquery can show Images from file:///C:?
Yeah...would be nice if someone took something like that and converted it to a plugin. Mario? YOu up for it? :) _ From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mario Moura Sent: Friday, August 17, 2007 2:58 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Jquery can show Images from file:///C:? Hi Wow. Looks great. ASAP I will study this I saw that fileExtension is caseSensitive so probably should have fileExtension == JPG fileExtension == jpg fileExtension == Jpg to avoid trouble. thanks a lot Andy for share this Regards Mario 2007/8/17, Joan Piedra mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]: Hello Andy, It looks interesting, I've tried this before but I had some difficulties with Firefox, at last I could do it with IE6, IE7, and Firefox. But Safari and Opera mask the whole url in the input file. So this won't work in those browsers. Regards, On 8/17/07, Andy Matthews mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: That's not true at all. I've got a JS file that allows for live previews. The JS file is attached, and here's the code needed to trigger it: form name=myForm input type=file name=photo_filebr input type=button name=button class=smaller value=Preview Image onclick=previewImage(document.myForm.photo_file.value) /form I can't say that it works on all computers, but I've never once had a client say that it didn't work. _ From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Joan Piedra Sent: Friday, August 17, 2007 12:39 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Jquery can show Images from file:///C:? Hey Mario, I had the same idea some time ago, but after trying some workarounds and reading a lot of browser docs I noticed this was an horrible and really bad practice in web development. So we actually can't make an image preview before sending data to the server. We will have to stick to the simple way, upload then preview. Cheers, On 8/7/07, Mario Moura mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi folks What I am trying is show an image into my browser with this tag img width=50 height=50 src=file:///C:/Users/example.JPG/ into my browser. Is it possible? or is a security lock from browsers? I am using $.post() So I could send the path that user choice C:/Users/example.JPG to my php and return img width=50 height=50 src=file:///C:/Users/example.JPG/ But isnt working because browsers cant show this tag img width=50 height=50 src=file:///C:/Users/example.JPG/ I can upload the file to webserver I know but will be more fast and I can save some bandwidth traffic if I could do this. And avoid malicious users consume my bandwidth traffic. So I am trying use AJAX to simulate Upload Ajax? and when forms is already send images normaly (without ajax). So Jquery can show Images from file:///C:? or something like this? Regards Mario -- Joan Piedra || Frontend webdeveloper http://joanpiedra.com/ -- Joan Piedra || Frontend webdeveloper http://joanpiedra.com/ http://joanpiedra.com/ -- Mário Alberto Chaves Moura [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 31-9157-6000
[jQuery] Re: Jquery can show Images from file:///C:?
No. On Aug 7, 4:28 pm, Mario Moura [EMAIL PROTECTED] wrote: Hi folks What I am trying is show an image into my browser with this tag img width=50 height=50 src=file:///C:/Users/example.JPG/ into my browser. Is it possible? or is a security lock from browsers? I am using $.post() So I could send the path that user choice C:/Users/example.JPG to my php and return img width=50 height=50 src=file:///C:/Users/example.JPG/ But isnt working because browsers cant show this tag img width=50 height=50 src=file:///C:/Users/example.JPG/ I can upload the file to webserver I know but will be more fast and I can save some bandwidth traffic if I could do this. And avoid malicious users consume my bandwidth traffic. So I am trying use AJAX to simulate Upload Ajax? and when forms is already send images normaly (without ajax). So Jquery can show Images from file:///C:? or something like this? Regards Mario
[jQuery] Re: Jquery can show Images from file:///C:?
On Aug 8, 1:28 am, Mario Moura [EMAIL PROTECTED] wrote: What I am trying is show an image into my browser with this tag img width=50 height=50 src=file:///C:/Users/example.JPG/ into my browser. Is it possible? or is a security lock from browsers? Both. It is possible, but only if your browser allows it. I am using $.post() It is likely that you won't be able to POST to a JPG file. You should use GET. For example, on my local web server i can POST to HTML files, but on my hosting provider i cannot - i have to use GET for HTML files. So I could send the path that user choice C:/Users/example.JPG to my php and return img width=50 height=50 src=file:///C:/Users/example.JPG/ Imagine what would happen if any JavaScript could read a local file and then POST it back to the web site. Scary stuff. But isnt working because browsers cant show this tag img width=50 height=50 src=file:///C:/Users/example.JPG/ As well it should not. See above. I can upload the file to webserver I know but will be more fast and I can save some bandwidth traffic if I could do this. And avoid malicious users consume my bandwidth traffic. But this feature is far more malicious than bandwidth theft. So Jquery can show Images from file:///C:? or something like this? This is not a question of jQ, but of JavaScript and the browser's security settings. i would NEVER enable my browser to allow reading of local files. i don't even think that Firefox lets you configure it to do that.
[jQuery] Re: Jquery can show Images from file:///C:?
Ok Stephan Thanks a lot for this explain. Now I can go to right way. Regards Mario 2007/8/7, Stephan Beal [EMAIL PROTECTED]: On Aug 8, 1:28 am, Mario Moura [EMAIL PROTECTED] wrote: What I am trying is show an image into my browser with this tag img width=50 height=50 src=file:///C:/Users/example.JPG/ into my browser. Is it possible? or is a security lock from browsers? Both. It is possible, but only if your browser allows it. I am using $.post() It is likely that you won't be able to POST to a JPG file. You should use GET. For example, on my local web server i can POST to HTML files, but on my hosting provider i cannot - i have to use GET for HTML files. So I could send the path that user choice C:/Users/example.JPG to my php and return img width=50 height=50 src=file:///C:/Users/example.JPG/ Imagine what would happen if any JavaScript could read a local file and then POST it back to the web site. Scary stuff. But isnt working because browsers cant show this tag img width=50 height=50 src=file:///C:/Users/example.JPG/ As well it should not. See above. I can upload the file to webserver I know but will be more fast and I can save some bandwidth traffic if I could do this. And avoid malicious users consume my bandwidth traffic. But this feature is far more malicious than bandwidth theft. So Jquery can show Images from file:///C:? or something like this? This is not a question of jQ, but of JavaScript and the browser's security settings. i would NEVER enable my browser to allow reading of local files. i don't even think that Firefox lets you configure it to do that. -- Mário Alberto Chaves Moura [EMAIL PROTECTED] 31-9157-6000