where "filename" is the *NAME* of the file that was assigned to
"file_content" in the input tag.
Apparently Ruby thinks my file is a string and that consequently it
has no 'read' method. What am I doing wrong and how can I get at the
actual file content?
Great thought and it would have really been embarrassing if that had
turned out to be the case; but, it wasn't. I do have the form set to
multipart with the following attribute to the form tag:
enctype="multipart/form-data"
I thought this was going to be some really obvious stupid error on my
part like the one you suggested and I thought someone would likely
point it out to me within a few minutes of my post. I guess that's
not the case. Now, I'm beginning to think that I don't understand
exactly what it is that comes back in the params hash as a result of
having a <input type="file"> tag in the form. If someone could
enlighten me on that, it would be great.
Great thought and it would have really been embarrassing if that had
turned out to be the case; but, it wasn't. I do have the form set to
multipart with the following attribute to the form tag:
enctype="multipart/form-data"
Have you verified in the browser that the expected html is generated?
Have you looked with a packet sniffer to see if the file is being sent
to the server?
As is usually the case in these types of situations, the problem
turned out to be a factor that I didn't deem as being relevant. That
factor is that access is being controlled by sessions. The brief
explanation is that I made my form by using straight HTML rather than
the Rails helpers. Without going into all of the gory details, one
needs to use the Rails helpers in this case. I now have it working.
Thanks for the input.
Master Cheung,
I see you mention a 'packet sniffer'. What is that and how does one
implement one?
I am grateful for any explanation.
Thank you,
Kathleen
Master Cheung,
I see you mention a 'packet sniffer'. What is that and how does one
implement one?
It's a piece of software that dumps/displays all the packets going
through your machine (usually with the ability to filter based on a
set of conditions so that you can narrow it down to what you're trying
to observe)
Eg tcpdump, wireshark (formally ethereal) etc..
On unixy platforms, there are a set of ruby bindings for libpcap (the
library that tcpdump uses) if you feel like doing your packet sniffing
from ruby.