Click to See Complete Forum and Search --> : Upload? Download? Browse?


khaki
02-25-2003, 02:01 PM
Question for the heavy-hitters:

How do they make those features where you can browse to the hard-drive to attach a file (like they do for the avatars on this site, and for attaching resumes and files on other sites)?
Is it done using Javascript ? (can something like that even be done on the client-side?)
If not, what then? (not PHP please. Ugh!)

This seems like something that would be good to know (like driving a stick-shift. Or... to take Charle's view: http://forums.webdeveloper.com/showthread.php?s=&threadid=4863 ...I'm loading-up the toolbox).

So what do they call that? Uploading? Downloading? Browse? (or does it depend on who is doing the uploading and who is getting the downloading?)

I've searched this site up and down and found only 1 place that mentioned something similar, but it referred to an ASP solution that doesn't seem to work on my server (grrrr... which really disappoints me, because I would love it to be an ASP solution), plus it loads the files into a database. Is that how it's typically done?

If I can find out what it's actually called, then maybe I can figure it out for myself (Google is just waitin' for me to punch it all in).

Alright, I've counted 10 question marks in this post (only 10?), so it's time for me to just shut-up and listen.

exceptionally curious and temporarily quiet...
k

Charles
02-25-2003, 02:08 PM
What you are describing is a browser specific but standardized way of handling a "file select" control. The "file select" control is created with the INPUT element. See http://www.w3.org/TR/html4/interact/forms.html#edef-INPUT.

pyro
02-25-2003, 02:21 PM
PHP :p is what I would use, but the same could be done with CGI/Perl or ASP, so you could post in one of those forums, if you'd rather use one of those...

Luckily, there is already an input type to browse to files, <input type="file"> So, all you need to do is write the code to handle the upload once the form is submitted.

khaki
02-25-2003, 02:42 PM
Wow, I can't tell you how much I enjoy a good Charles answer!
And I am changing my evil ways.... from now on... it's straight to the W3!
(and then you guys. No offense. Just kidding).

And to the individual who took the time to point-out that my question could have simply been asked as such:
" How do they make those features where you can browse to the hard-drive to attach a file (like they do for the avatars on this site, and for attaching resumes and files on other sites)? "

Message recieved. Fair enough.
I'm jacked-up on the Dew. I'll tone it down.
(but it never ceases to amaze me that people will take the time to make me feel stupid for how I go about saying something, but then not take the time to answer my question. It's a bit rude... and please stop emailing me).

So in the future, if anyone wants to email me to tell me to be "pithy" (obviously a fellow O'Rieley fan! lol), then please offer your advice in the form of an answer (thanks for your viewpoint... we'll let the public decide. lol).

And Charles.... thank you so much (I'm glad that I quoted ya!).
I'll grab a cup of decaf and check-out that link. Then I'll see what PHPyro (ugh.. your great sweetie, but you won't convert me) is referring to in regard to the form handler. (and if I still need help I'll post the "pithy" version in the ASP forum. Will that make you happy, "Mr No-Spin Zone"? And I don't even think that Bill would even like you... so get over yourself. lol).

slinky away quietly for the rest of the day...
k
(and seldom pithy)

Nedals
02-25-2003, 03:03 PM
As stated you will need to use an <input type="file"..... That does the browse part
Don't forget to add... enctype="multipart/form-data" in your FORM tag and use method="post"

You will then need to caputure your data using... Request.Form(element) in your ASP script.
I'm not familiar with ASP but I'm sure your documentation will tell you exactly how. My brief
documentation mentions a BinaryRead which you will most likely need.

Sorry I can't be of further help.

pyro
02-25-2003, 04:47 PM
Originally posted by khaki
you won't convert meI have to at least try :D

khaki
02-26-2003, 07:06 AM
Thank you Dave - I just took a quick look over there and I am definitley looking forward to examining it closer.

In the meantime, I want to quickly give the link for that thread, since this one is no longer pertinent:
http://forums.webdeveloper.com/showthread.php?s=&threadid=4897

(sorry everybody... I would have provided this link sooner, but I was waiting to see if the ASP forum would steer me towards the PHP forum first. I didn't want to be running anybody around all over the boards in order to see how to do this feature).
k