Radio Buttons used for FileUploaders?

Radio Buttons used for FileUploaders?

am 30.12.2007 06:26:25 von unknown

I need some help guys. I'm trying to modify a working MIDI ringtone
uploader (HTML code) to use radio buttons rather than the standard
"" file selector so the user doesn't have to browse and
choose from hundreds of MIDI files or manually type the MIDI filename
into the input box.


How do I replace this:



With FOUR simple radio buttons like this:






When I replace with the above radio
buttons and try it out the server returns this error: "Upload Failed,
Please Pickup a valid audio file".

But the files are VALID they work fine using name=file> but not with the radio buttons. What am I missing here? The
MIDI's are in the same directory as the HTML file, I even tried
changing the radio button values to the "Exact" file location ie:
value="c:/midi/song1.mid" and it still doesn't work. Any suggestions?
I'm willing to use a drop down box instead but I'd need to see some
sample code of how that's done.

Re: Radio Buttons used for FileUploaders?

am 30.12.2007 11:01:45 von Neredbojias

Well bust mah britches and call me cheeky, on Sun, 30 Dec 2007 05:26:25 GMT
scribed:

> I need some help guys. I'm trying to modify a working MIDI ringtone
> uploader (HTML code) to use radio buttons rather than the standard
> "" file selector so the user doesn't have to browse and
> choose from hundreds of MIDI files or manually type the MIDI filename
> into the input box.
>
>
> How do I replace this:
>
>
>
> With FOUR simple radio buttons like this:
>
>
>
>
>
>
> When I replace with the above radio
> buttons and try it out the server returns this error: "Upload Failed,
> Please Pickup a valid audio file".
>
> But the files are VALID they work fine using > name=file> but not with the radio buttons. What am I missing here? The
> MIDI's are in the same directory as the HTML file, I even tried
> changing the radio button values to the "Exact" file location ie:
> value="c:/midi/song1.mid" and it still doesn't work. Any suggestions?
> I'm willing to use a drop down box instead but I'd need to see some
> sample code of how that's done.

Using radio buttons for file uploads in forms doesn't work because
currently only inputs can be "file select" (upload) elements.

--
Neredbojias
Riches are their own reward.

Re: Radio Buttons used for FileUploaders?

am 30.12.2007 11:04:21 von jkorpela

Scripsit Johnny:

> I need some help guys. I'm trying to modify a working MIDI ringtone
> uploader (HTML code) to use radio buttons rather than the standard
> "" file selector

You cannot.

> so the user doesn't have to browse and
> choose from hundreds of MIDI files or manually type the MIDI filename
> into the input box.

File input is awkward, the way it has been implemented in browsers. But
that's what you need to play with, unless you want to try something
difficult using client-side scripting, where you will probably encounter
serious problems classifiable as "security settings".

> How do I replace this:
>
>

You don't.

> With FOUR simple radio buttons like this:
>
>
>
>
>

That's just controls for selecting between four alternatives and
resulting in data like song=song1.mid added to the form data set. There
is no association with any files in the user's system. The data is just
a string of characters. Naturally, when the server receives it, it has
no way of using the data to access files in the user's system.

File input works in a different way: the browser copies the _content_ of
the selected file into the form data (possibly together with its file
name, which is usually irrelevant to the server),

> When I replace with the above radio
> buttons and try it out the server returns this error: "Upload Failed,
> Please Pickup a valid audio file".

No wonder. No audio file was sent.

> But the files are VALID they work fine using > name=file> but not with the radio buttons. What am I missing here?´

The idea of file input. See my dusty old page on it:
http://www.cs.tut.fi/~jkorpela/forms/file.html

> The
> MIDI's are in the same directory as the HTML file, I even tried
> changing the radio button values to the "Exact" file location ie:
> value="c:/midi/song1.mid" and it still doesn't work.

It's not supposed to work. Such a string is still just a string. No
software involved tries to interpret it as any kind of file name. If the
server tried to do that, what good would it do to access _is_ C disk (if
any)? Accessing the user's C disk would involve a horrendous security
problem (even if such access from server to client would be limited to
read-only).

> I'm willing to use a drop down box instead

Not possible either.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Re: Radio Buttons used for FileUploaders?

am 31.12.2007 01:13:25 von W E B G U R L

On Sun, 30 Dec 2007 12:04:21 +0200, "Jukka K. Korpela"
wrote:

>Scripsit Johnny:
>
>> I need some help guys. I'm trying to modify a working MIDI ringtone
>> uploader (HTML code) to use radio buttons rather than the standard
>> "" file selector
>
>You cannot.
>
>> so the user doesn't have to browse and
>> choose from hundreds of MIDI files or manually type the MIDI filename
>> into the input box.
>
>File input is awkward, the way it has been implemented in browsers. But
>that's what you need to play with, unless you want to try something
>difficult using client-side scripting, where you will probably encounter
>serious problems classifiable as "security settings".
>
>> How do I replace this:
>>
>>
>
>You don't.
>
>> With FOUR simple radio buttons like this:
>>
>>
>>
>>
>>
>
>That's just controls for selecting between four alternatives and
>resulting in data like song=song1.mid added to the form data set. There
>is no association with any files in the user's system. The data is just
>a string of characters. Naturally, when the server receives it, it has
>no way of using the data to access files in the user's system.
>
>File input works in a different way: the browser copies the _content_ of
>the selected file into the form data (possibly together with its file
>name, which is usually irrelevant to the server),
>
>> When I replace with the above radio
>> buttons and try it out the server returns this error: "Upload Failed,
>> Please Pickup a valid audio file".
>
>No wonder. No audio file was sent.
>
>> But the files are VALID they work fine using >> name=file> but not with the radio buttons. What am I missing here?´
>
>The idea of file input. See my dusty old page on it:
>http://www.cs.tut.fi/~jkorpela/forms/file.html
>
>> The
>> MIDI's are in the same directory as the HTML file, I even tried
>> changing the radio button values to the "Exact" file location ie:
>> value="c:/midi/song1.mid" and it still doesn't work.
>
>It's not supposed to work. Such a string is still just a string. No
>software involved tries to interpret it as any kind of file name. If the
>server tried to do that, what good would it do to access _is_ C disk (if
>any)? Accessing the user's C disk would involve a horrendous security
>problem (even if such access from server to client would be limited to
>read-only).
>
>> I'm willing to use a drop down box instead
>
>Not possible either.


Thanks Jukka your explanation makes sense and your web site was
fantastic reading. I learned a lot. Thanks again.

Re: Radio Buttons used for FileUploaders?

am 31.12.2007 02:05:08 von dorayme

In article ,
Johnny wrote:

> Thanks Jukka your explanation makes sense and your web site was
> fantastic reading. I learned a lot. Thanks again.

If you read more of him, you would not quote so unnecessarily.

--
dorayme