Feb 5, 2001, 7:11 PM
Post #1 of 4
i've taken on the challenge of trying to build my own multiple upload script without the use of modules (not as hard as some people think). I just have a couple of questions.
learning how to upload, need guidance
I went through several attempts, and noticed that each file is separated with 29 dashes, and 11 random characters. Ok, so i grab the first line before any line breaks, and split by that value. The problem is that the last line has an extra 2 dashes at the end, and it wont split. Is that common with all servers? Would it be more wise to split .. for example:
@files = split(/-----------------------------abcdefghijk(--)?/, $buffer);
Is there an easier solution? I'm thinking of just using the pop function to remove the last line with the 2 extra dashes, or try to remove it from the buffer altogether.
Secondly, when i do upload any files, they lose all formatting. I grab the main part of each file, print it to a new file on the server, but when i go to check the file, all formatting disappears, what goes wrong? At first i thought that it was because i was uploading from windows to unix, and all \r characters get lost, but are they actually stripped out when they're on a unix machine?
Finally, when i currently upload, i do check for improper characters in a filename ( all characters that windows currently doesn't allow in a filename )... is it necessary? I mean windows and other operating systems (i think) already restrict some characters on filenames, should i take that further?
sorry ahead of time if the words i used were used in the wrong context, i wasn't too clear on what to call my variables, so i just followed others ^_^.