jQuery in Action, 2nd edition*
The moose likes HTML, CSS and JavaScript and the fly likes problem in photo upload in IE7 and mozilla by using javacsript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "problem in photo upload in IE7 and mozilla by using javacsript" Watch "problem in photo upload in IE7 and mozilla by using javacsript" New topic
Author

problem in photo upload in IE7 and mozilla by using javacsript

manohar penumarthi
Greenhorn

Joined: Sep 25, 2008
Posts: 2
function uploadForm()
{
document.forms[0].cmpLogo.value = document.forms[0].companyLogo.value;
if (fileTypeCheck() == false)
{
return false;
}
document.forms[0].compLogo.src = document.forms[0].companyLogo.value;
}

function fileTypeCheck()
{
var reOkFiles=/\.(jpg|JPG|jpeg|JPEG|gif|GIF)$/i;
if(document.forms[0].companyLogo.value != "")
{
var fileStr =document.forms[0].companyLogo.value;
if(!reOkFiles.test(fileStr))
{
alert("Please upload only jpg, jpeg or gif file formates");
return false;
}
}
}
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60804
    
  65

And?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You can not set an image to the source of a local image file.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in photo upload in IE7 and mozilla by using javacsript
 
Similar Threads
Ajax javascript not recieving responseText from Struts
How to get Image from request
Help needed with IE 6.0 submit
ajax file upload and javascript
Struts 1