chili!upload only uploads filepath from client

Hi, i have a very frustrating problem with chili!upload.

i use the following code to my upload-script:

<%if request.querystring("s") = "" then%>

<form action="upload.asp?s=2" method="post" enctype="multipart/form-data">

<input type="file" name="file">

<input type="submit" Value="Upload">

</form>

<%else

response.Expires = 0

Set fbase = Server.CreateObject("Chili.Upload.1")

fbase.SizeLimit = 1000000

fbase.SaveToFile(Server.mapPath("/") & "/upload/" & fbase.SourceFileName)

%>

<h1>Success</h1>

Filen <%=fbase.SourceFileName%> blev uploadet til serveren

Den fylder <%=fbase.FileSize%> bytes.

<%end if%>

But 80% of the time i try upload a file, the script fails. When i then go to my directory with should contain the file, all i find is a mysterious file, with a name like "c:\documents and settings\username\pictures\filename.jpg". the filesize is what it should be, but the filename is kind of weird, as it is the full path to the file uploaded on the clients computer.

what can i do to avoid this problem?

[1197 byte] By [ProximaCentauria] at [2007-11-27 8:28:28]
# 1

Page 517 of the manual.

Chili!Upload SourceFileName Method (Read-Only)

The SourceFileName method returns the full path or file name of the uploaded file.

This method takes an optional Boolean argument. If FALSE, only the file name is

returned. If TRUE (the default), the full path is returned.

Some of us get very frustrated that no one reads the manuals.....

:o)

Duncan

Duncan_Berrimana at 2007-7-12 20:18:28 > top of Java-index,Web & Directory Servers,Web Servers...
# 2
hmm.. well you have a point there, with the manual :)But what is the solution to my problem then?
ProximaCentauria at 2007-7-12 20:18:28 > top of Java-index,Web & Directory Servers,Web Servers...
# 3
Well if I have to spell it out for you.....So pass False to SourceFileName as a parameter which tells it just to return the file name rather than the full path as the text from the manual I posted says.Duncan
Duncan_Berrimana at 2007-7-12 20:18:28 > top of Java-index,Web & Directory Servers,Web Servers...