Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   Coloring input type=file browse button; uploading multiple files (http://www.velocityreviews.com/forums/t157990-coloring-input-type-file-browse-button-uploading-multiple-files.html)

Ron Brennan 05-10-2004 09:34 PM

Coloring input type=file browse button; uploading multiple files
 
Good afternoon.

The entire task that I'm trying to achieve is to allow a user to browse and
upload multiple files simultaneously, hiding the Browse button of <input>
tags of type="file" and replacing it with a button of my own background
color and text.

The file paths I'd like displayed in a textarea and then the files uploaded
at once.

The code chunks toward my goal I got from the Web (below) I think worked
before IE 5.0 but for me produces an "Access Denied" error.

Can anybody help with any part of my problem (coloring the browse button,
listing multiple chosen files in a textarea, uploading an artibrary number
of files at once)?

Thanks, Ron.




Jukka K. Korpela 05-10-2004 10:00 PM

Re: Coloring input type=file browse button; uploading multiple files
 
"Ron Brennan" <rbrennan@magma.ca> wrote:

> The entire task that I'm trying to achieve is to allow a user to
> browse and upload multiple files simultaneously, hiding the Browse
> button of <input> tags of type="file" and replacing it with a button
> of my own background color and text.


Well, just stop trying that. File input is confusing enough to users,
partly because it _is_ complex, partly because implementations are lousy.
No reason to mess things up any more by attempts to change the appearance
of widgets.

> The code chunks toward my goal I got from the Web (below) I think
> worked before IE 5.0 but for me produces an "Access Denied" error.


Below what? If you tried to insert a copy of some code, it failed, and
you should have posted a URL instead.

> Can anybody help with any part of my problem (coloring the browse
> button, listing multiple chosen files in a textarea, uploading an
> artibrary number of files at once)?


Write a new browser. The browser that comes closest to a decent
implementation of input type=file is Opera, but there's a lot to be
improved there. And make the browser free and so good that most people
want to get it. Sit back and wait for a couple of months, or years.

Alternatively, live with the existing limitations. If the intent is to
allow submission of multiple files, you might encourage your visitors to
zip their file collections and just submit the zipped file. You would
naturally have to unzip the stuff somehow. The details depend on what you
are really doing. (I guess it wouldn't be too difficult to make a form
handler unzip a file automatically and process the individual files.)

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html



Ron Brennan 05-10-2004 10:18 PM

Re: Coloring input type=file browse button; uploading multiple files
 

"Jukka K. Korpela" <jkorpela@cs.tut.fi> wrote in message
news:Xns94E69D3239AAjkorpelacstutfi@193.229.0.31.. .
> "Ron Brennan" <rbrennan@magma.ca> wrote:
>
> > The entire task that I'm trying to achieve is to allow a user to
> > browse and upload multiple files simultaneously, hiding the Browse
> > button of <input> tags of type="file" and replacing it with a button
> > of my own background color and text.

>
> Well, just stop trying that. File input is confusing enough to users,
> partly because it _is_ complex, partly because implementations are lousy.
> No reason to mess things up any more by attempts to change the appearance
> of widgets.
>
> > The code chunks toward my goal I got from the Web (below) I think
> > worked before IE 5.0 but for me produces an "Access Denied" error.

>
> Below what? If you tried to insert a copy of some code, it failed, and
> you should have posted a URL instead.
>
> > Can anybody help with any part of my problem (coloring the browse
> > button, listing multiple chosen files in a textarea, uploading an
> > artibrary number of files at once)?

>
> Write a new browser. The browser that comes closest to a decent
> implementation of input type=file is Opera, but there's a lot to be
> improved there. And make the browser free and so good that most people
> want to get it. Sit back and wait for a couple of months, or years.
>
> Alternatively, live with the existing limitations. If the intent is to
> allow submission of multiple files, you might encourage your visitors to
> zip their file collections and just submit the zipped file. You would
> naturally have to unzip the stuff somehow. The details depend on what you
> are really doing. (I guess it wouldn't be too difficult to make a form
> handler unzip a file automatically and process the individual files.)
>
> --
> Yucca, http://www.cs.tut.fi/~jkorpela/
> Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
>

-------------------------------------------------
"If you tried to insert a copy of some code, it failed, and you should have
posted a URL instead."

The code is actually embeded in a servlet. In regards to the other comments,
the objective is to make the pages as attractive and easy to use as
possible. I am just trying to find out what is possible, and that I haven't
thought of or found.





Disco Octopus 05-10-2004 10:55 PM

Re: Coloring input type=file browse button; uploading multiple files
 
Ron Brennan wrote:
> Good afternoon.
>
> The entire task that I'm trying to achieve is to allow a user to
> browse and upload multiple files simultaneously, hiding the Browse
> button of <input> tags of type="file" and replacing it with a button
> of my own background color and text.
>
> The file paths I'd like displayed in a textarea and then the files
> uploaded at once.
>
> The code chunks toward my goal I got from the Web (below) I think
> worked before IE 5.0 but for me produces an "Access Denied" error.
>
> Can anybody help with any part of my problem (coloring the browse
> button, listing multiple chosen files in a textarea, uploading an
> artibrary number of files at once)?
>
> Thanks, Ron.



this code may be helpful if you want to do a multiple file upload....

<html>
<head>
<script type="text/javascript">
function addafile(){
vp = document.getElementById("poobear");
vp.innerHTML += "<p><input name=\"eeyore[]\"
type=\"file\"></p>";
}
</script>
</head>
<body>
<p><input name="tigger" type="submit" onclick="addafile();" value="do
it"></p>
<div id="poobear"></div>
</body>
</html>







Ron Brennan 05-10-2004 11:28 PM

Re: Coloring input type=file browse button; uploading multiple files
 
"Disco Octopus" <discooctopusN05PAM@yahoo.com> wrote in message
news:VLTnc.2029$IH5.90349@news.optus.net.au...
> Ron Brennan wrote:
> > Good afternoon.
> >
> > The entire task that I'm trying to achieve is to allow a user to
> > browse and upload multiple files simultaneously, hiding the Browse
> > button of <input> tags of type="file" and replacing it with a button
> > of my own background color and text.
> >
> > The file paths I'd like displayed in a textarea and then the files
> > uploaded at once.
> >
> > The code chunks toward my goal I got from the Web (below) I think
> > worked before IE 5.0 but for me produces an "Access Denied" error.
> >
> > Can anybody help with any part of my problem (coloring the browse
> > button, listing multiple chosen files in a textarea, uploading an
> > artibrary number of files at once)?
> >
> > Thanks, Ron.

>
>
> this code may be helpful if you want to do a multiple file upload....
>
> <html>
> <head>
> <script type="text/javascript">
> function addafile(){
> vp = document.getElementById("poobear");
> vp.innerHTML += "<p><input name=\"eeyore[]\"
> type=\"file\"></p>";
> }
> </script>
> </head>
> <body>
> <p><input name="tigger" type="submit" onclick="addafile();"

value="do
> it"></p>
> <div id="poobear"></div>
> </body>
> </html>
>

--------------------------------------
Im sorry, but I'm obviously not understanding what this is doing. It seems
to me to be sending nothing to the server. When the user presses trigger,
the browser inserts the input element but sends the request to the server
even before the user has an opportunity to press the <input> browse button.
Where am going wrong?



Disco Octopus 05-11-2004 01:38 AM

Re: Coloring input type=file browse button; uploading multiple files
 
Ron Brennan wrote:
> "Disco Octopus" <discooctopusN05PAM@yahoo.com> wrote in message
> news:VLTnc.2029$IH5.90349@news.optus.net.au...
>> Ron Brennan wrote:
>> this code may be helpful if you want to do a multiple file upload....
>>
>> <html>
>> <head>
>> <script type="text/javascript">
>> function addafile(){
>> vp = document.getElementById("poobear");
>> vp.innerHTML += "<p><input name=\"eeyore[]\"
>> type=\"file\"></p>";
>> }
>> </script>
>> </head>
>> <body>
>> <p><input name="tigger" type="submit" onclick="addafile();"
>> value="do it"></p>
>> <div id="poobear"></div>
>> </body>
>> </html>
>>

> --------------------------------------
> Im sorry, but I'm obviously not understanding what this is doing. It
> seems to me to be sending nothing to the server. When the user
> presses trigger, the browser inserts the input element but sends the
> request to the server even before the user has an opportunity to
> press the <input> browse button. Where am going wrong?


no. i was just giving you an example of a potential way to have someone
upload multiple files. all they do is click the button to make new input
fields, and then you can work out the rest. yes? no?



Disco Octopus 05-11-2004 01:41 AM

Re: Coloring input type=file browse button; uploading multiple files
 
Disco Octopus wrote:
> Ron Brennan wrote:
>> "Disco Octopus" <discooctopusN05PAM@yahoo.com> wrote in message
>> news:VLTnc.2029$IH5.90349@news.optus.net.au...
>>> Ron Brennan wrote:
>>> value="do it"></p>
>>> <div id="poobear"></div>
>>> </body>
>>> </html>
>>>

>> --------------------------------------
>> Im sorry, but I'm obviously not understanding what this is doing. It
>> seems to me to be sending nothing to the server. When the user
>> presses trigger, the browser inserts the input element but sends the
>> request to the server even before the user has an opportunity to
>> press the <input> browse button. Where am going wrong?

>
> no. i was just giving you an example of a potential way to have
> someone upload multiple files. all they do is click the button to
> make new input fields, and then you can work out the rest. yes? no?



i see what you mean... i think.... try this then.....

<html>
<head>
<script type="text/javascript">
function addafile(){
vp = document.getElementById("poobear");
vp.innerHTML += "<p><input name=\"eeyore[]\"
type=\"file\"></p>";
}
</script>
</head>
<body>
<p><input name="tigger" type="button" onclick="addafile();" value="add
a thing"></p>
<div id="poobear"></div>
<p><input name="otherthing" type="submit" value="send them now"></p>
</body>
</html>




Jukka K. Korpela 05-11-2004 05:45 AM

Re: Coloring input type=file browse button; uploading multiple files
 
"Ron Brennan" <rbrennan@magma.ca> wrote:

> "If you tried to insert a copy of some code, it failed, and you
> should have posted a URL instead."


Why did you quote my entire message and _then_ a separate statement, in a
quotation style that deviates from Usenet conventions? You didn't even
answer that statement:

> The code is actually embeded in a servlet.


What code? And you still didn't explain the "(below)" part.

Hints for Usenet conduct: http://www.cs.tut.fi/~jkorpela/usenet/dont.html

> In regards to the other
> comments, the objective is to make the pages as attractive and easy
> to use as possible.


You did not address any of the content of my comments. That's actually
typical. Comprehensive quoting is an almost sure sign of lack of
comprehensive reading.

> I am just trying to find out what is possible,
> and that I haven't thought of or found.


As you wish. That won't take you closer to making the pages attractive,
and especially not closer to making them easy to use.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html



Jukka K. Korpela 05-11-2004 05:49 AM

Re: Coloring input type=file browse button; uploading multiple files
 
"Disco Octopus" <discooctopusN05PAM@yahoo.com> wrote:

> <body>
> <p><input name="tigger" type="button" onclick="addafile();"
> value="add
> a thing"></p>
> <div id="poobear"></div>
> <p><input name="otherthing" type="submit" value="send them
> now"></p>
> </body>


Now you have a body that contains a button which, when clicked on, does
nothing, and a submit button that submits empty data - unless the user is
careless enough to have client-side scripting enabled (too few virus
experiences?) _and_ happens to use a browser that supports a suitable
version of a scripting language _and_ guesses what's going on (instead
of, say, moving quickly away when a page starts behaving in an odd way).

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html



Neal 05-11-2004 06:02 AM

Re: Coloring input type=file browse button; uploading multiple files
 
On Tue, 11 May 2004 05:45:46 +0000 (UTC), Jukka K. Korpela
<jkorpela@cs.tut.fi> wrote:

> What code? And you still didn't explain the "(below)" part.
>
> Hints for Usenet conduct: http://www.cs.tut.fi/~jkorpela/usenet/dont.html


I'm having trouble determing which of the 7 rules he's violated.


All times are GMT. The time now is 04:42 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.