There are several ways to glean the filename from the http upload of a file. This seems to work the best:

<FORM "fileUpload" 0000,7F7F,0000<@CGI><@APPFILE>FFFF,0000,0000">" "POST" 0000,0000,FFFF">>
File to upload: <INPUT "FILE" 0000,0000,FFFF">>
<INPUT "HIDDEN" 0000,0000,FFFF">>
<INPUT "BUTTON" "Upload"
FFFE,0000,0000fileUploadFFFF,0000,0000.FFFE,0000,0000fileNameFFFF,0000,0000.value=document.fileUpload.file.value;document.TheForm.submit();"0000,0000,FFFF">>
</FORM>

The only issue is that the filename will always contain the full path, which is what you are getting. For some reason, you are getting a monster path with this guy. Use the tokenize meta tag to seperate the file name from the path. You will have to determine if the path is windows or mac. On OS X and 9, the path will be like so:

/macinintosh hd/aFolder/theFile.jpg

On windows it will be:

c:\aFolder\theFile.jpg

So you will have to determine the platform either with javascript, or with <@cgiparam>. Once you determine the platform, tokenize the <@arg fileName> from the above form with either the "/" as the seperator, or "\" as the seperator. You should then have an array, the last row of the array is your file name.

Robert

On Thursday, September 5, 2002, at 08:30 PM, <[EMAIL PROTECTED]> wrote:

Hello all,

I am having a problem�when uploading a file from a Mac (client) to Tango_2000_SP1 server (running under Windows NT 4.0 server).
The upload itself is working fine, but the name of the file I get is huge, for ex.:

macintosh+hd%2fdesktop+folder%2frecovered+desktop1%21%2frecovered+%231%2fikuko%2fmjb+3+ir+refurb62+folder%2fmjb3+ir.jpg

which I believe is the way a full pathname looks like on a Mac computer (obviously I do not know much Macs).

I am pretty sure that sometimes the procedure works fine (I had users transferring files from Macs), but there is at least this one instance in which I got the above filename.
Does anybody have any idea why this is happening?

(Uploads from PCs to TangoServer work always).

Many thanks,
Mike.



--

Robert Garcia
BigHead Technology
2781 N Carlmont Pl
Simi Valley, CA 93065
Phone 805.522.8577
http://www.bighead.net/
http://www.theradmac.com/
[EMAIL PROTECTED]

Reply via email to