Solved

reg the input tag of  type  file

Posted on 2004-10-20
9
174 Views
Last Modified: 2010-04-01
Hi,

we are using a file upload utility in our web application. We wanted to upload the document and save it in our db2 database.

we want to know about two things

1. when we are using the html tag <input type='file' value =''> we are getting the standard java browse button. we wanted to replace this with our button image. how we can over ride this.

2. when we click the upload button the selected file should be carried to the server how we can process this. i have some basic idea of implementing this with the multipart form. can anyone highlight on this.


Thanks & Rgds,
Murali
0
Comment
Question by:ayen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
9 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 125 total points
ID: 12367705
1) you can't :-(  It's a real shame too, as I'd love that...but unfortunately, you cant :-(
2) http://jakarta.apache.org/commons/fileupload/  or  the upload package of http://www.servlets.com/cos/ should do it for you :-)

Both come with examples :-)
0
 
LVL 9

Expert Comment

by:Ovi
ID: 12368298
1. You can try via CSS to setup your browse button look.
2. As above by TimYates.

Cheers.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12368329
>  1. You can try via CSS to setup your browse button look.

Doesn't work :-(

At least I couldn't get it to work...  Because the FILE input thing is hardwired to the browser and OS, and isn't affected by CSS...  Apparently, you "could" change the "Browse" text by using a signed bit of javasript in one version of Mozilla...  But in real life it really isn't worth the effort trying...  You have to make do with the boring, boring style that's given to you :-(
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Expert Comment

by:TimYates
ID: 12368338
OOOOOOOOOOOOH!

Just did some searching around again, and it looks like Ovi was right:

http://www.quirksmode.org/dom/inputfile.html

However it has to be sait that you should be careful with soing this, as it doesn't really look like it's going to select a file from your hard drive (as I am used to FILE tags unstyled), so you could have problems with usability...
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12368347
And, if you look at that page....it's a complete pain in the arse...  And each browser you are writing for will look slightly different (unless you jump through css/javascript hoops)

So;  if it's for an intranet site, where you know what browser is going to be used...it could be cool.... otherwise, it's probably not worth the effort :-)

Lazy Tim

;-)
0
 
LVL 9

Expert Comment

by:Ovi
ID: 12368959
Yeah, Tim, you're right.

I have not done this for the bowse button, but I did once for a submit button with pure CSS. I guess should work in this case too.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12369002
It's weird, because the "Browse" button is tied into the browser (for th file select dialog), it tends to ignore all CSS and attempts at restyling it :-(

As you say, sumbit buttons and normal text fields are easy with CSS :-)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Display the newly inserted values 3 83
reflection example 3 118
memory representation of int[][][] a=new int[2][][]; 10 60
maven j2ee examles 2 64
Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
Building a cohesive image for your brand is vital to making an impression on consumers. When the economy is tough, brands do better than unbranded  products. This can have a huge impact on your long-term profits, as the economy goes up and down.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question