|
Posted by joshbeall on 01/23/06 20:54
Hi All,
If I drop a form onto my page that allows file uploads, I know well
enough how to handle the file upload in the server side via PHP.
However, I have a question: when my browser actually *sends* a binary
file (e.g., an image), does it encode it somehow for the upload? Or
does it simply send a raw bytestream?
The reason I am asking is that I am in the process of transferring some
images from one photo gallery to another (in Drupal). Mapping the two
database schemas has proved to be a little tricky, and I am thinking
it would be simpler to use the web interface to re-upload the various
images.
However, rather than do it one at a time, I'd just as soon write a PHP
script that would traverse through the old photo gallery files, and
upload them via HTTP POST (along with other relevant details, such as
descriptive text) and let the web interface make sure that the
database.
I'm comfortable with regular HTTP POST mechanisms, and doing them
programmatically with PHP, but I've never uploaded files that way.
Anything I should know? For example, do they need to be encoded
somehow before upload? Or can I just read in the raw bytestream, and
voila, there we go?
Navigation:
[Reply to this message]
|