Create a button to mimic the input file type?

T

tshimanga

Hi,
I have search, high and low on how to mimic the html foem input file
type.
Is this actually do able?
If I could open the brow pop up via link, select a file place the
result in a hidden field,
then upload the form via "<form method="post" enctype="multipart/form-
data">"
 
T

The Natural Philosopher

rf said:
No, it is not.

Yes, it is, but its highly browser specific.

You essentially overlay the button that the browser provides with your
own design, and use a bit of script to make it behave as you want.

So you still need the 'input type file', but you can dictate its
appearance by some pretty lousy hacks to layers over it.

Maybe that wasn't what you wanted to know, though.
 
R

rf

The said:
Yes, it is, but its highly browser specific.

You essentially overlay the button that the browser provides with your
own design, and use a bit of script to make it behave as you want.

So you still need the 'input type file', but you can dictate its
appearance by some pretty lousy hacks to layers over it.

Maybe that wasn't what you wanted to know, though.

ROFL.
 
T

Tim Slattery

The Natural Philosopher said:
So you still need the 'input type file', but you can dictate its
appearance by some pretty lousy hacks to layers over it.

You can change its appearance that way, but you can't do much about
its behavior. <input type="file"...> is the *only* way to upload a
file via HTML/HTTP. And that element is read-only, you cannot assign a
value to it. Good thing too, or web sites would be able to upload any
file from your disk without you knowing about it.
 
T

The Natural Philosopher

Tim said:
You can change its appearance that way, but you can't do much about
its behavior. <input type="file"...> is the *only* way to upload a
file via HTML/HTTP. And that element is read-only, you cannot assign a
value to it. Good thing too, or web sites would be able to upload any
file from your disk without you knowing about it.
Blimey. This post crept in late.,where's it been?

Agree 100%.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top