Post by kokenge on Apr 11, 2008 19:35:20 GMT -5
I get an error when to do a upload and then a hasanswer() files test.
I test the file to see if it is already uploaded. If already on file I give a message so the user knows it's already on file.
I only allow uploads of files that are NOT on file.
The file test always says it's is already on file???
I burned the directory and file name into the first test and it works.
However the second test that uses field names for the directory and file, fails??
Here is the messages I get based on the code below.
test1 gives the correct test
-----------------------------
test2 gives the incorrect test
as follows:
Here is the code. Both test the SAME thing.
Why do they different test results???
What am I doing wrong???
Thanks for the help
I test the file to see if it is already uploaded. If already on file I give a message so the user knows it's already on file.
I only allow uploads of files that are NOT on file.
The file test always says it's is already on file???
I burned the directory and file name into the first test and it works.
However the second test that uses field names for the directory and file, fails??
Here is the messages I get based on the code below.
test1 gives the correct test
-----------------------------
test2 gives the incorrect test
as follows:
test1 - c:\rbp\album_project\media\ben28.jpg not on file
---------------------------
test2 - c:\rbp\album_project\media\ben28.jpg already on file
Here is the code. Both test the SAME thing.
Why do they different test results???
html "<center><TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0><TR><TD BGCOLOR=tan>"
upload "Select a file to upload"; newmedId$
html "</TD</TR></TABLE>"
files #f, "c:\rbp\album_project\media\ben28.jpg"
if #f HASANSWER() > 0 then
html "test1 - c:\rbp\album_project\media\ben28.jpg already on file"
else
html "test1 - c:\rbp\album_project\media\ben28.jpg not on file"
end if
html "<HR>"
projectDir$ = "album_project"
mediaDir$ = DefaultDir$ + "\" + projectDir$ + "\media\"
files #f, mediadDir$;newmedId$
if #f HASANSWER() > 0 then
html "test2 - ";mediaDir$;newmedId$;" already on file"
else
html "test2 - ";mediaDir$;newmedId$;" not on file"
end if
What am I doing wrong???
Thanks for the help