Hi all!
Here's my prob (it seems kinda silly cos it's so simple):
I wrote a very small script that uses the ASPUpload object by Persits ( It's pretty basic, and just allows you to upload to different folders on the server, and it does that well. However, I'm trying to find a way that will allow me to upload any file, but it will always be given a specified file name. Eg If I upload readme1.txt it will be renamed readme.txt so I can upload readme2.txt, readme3.txt, readme4.txt etc and they will always just overwrite the existing readme.txt file on the server.
Here's what the basic of the current script:
<%
strFolder = Request.querystring("dest"
strPath = server.mappath(strFolder)
Set Upload = Server.CreateObject("Persits.Upload.1"
Count = Upload.Save(strPath)
%>
<HTML>
<BODY BGcolor="#000000" vlink="#FFFFFF" alink="#FFFFFF" link="#FFFFFF">
<center><b><font color="#FFFFFF">
<% = Count %> files uploaded successfully! </b></font><br><br>
<a href="uploadform.asp">Back to upload form</a>
</center>
</BODY>
</HTML>
Now I've been trying the file.Move way of doing it which should work, but I keep getting an Object required error on the line referring to file.Move:
<%
...
Set Upload = Server.CreateObject("Persits.Upload.1"
Count = Upload.Save(strPath)
file.Move strPath & "/read.txt"
...
%>
I've tried various combinations of this and it's just not having any of it. I think it's probably blatantly obvious, but I can't see what I'm doing wrong. Any ideas anyone!?
Thanks a lot in advance!
Here's my prob (it seems kinda silly cos it's so simple):
I wrote a very small script that uses the ASPUpload object by Persits ( It's pretty basic, and just allows you to upload to different folders on the server, and it does that well. However, I'm trying to find a way that will allow me to upload any file, but it will always be given a specified file name. Eg If I upload readme1.txt it will be renamed readme.txt so I can upload readme2.txt, readme3.txt, readme4.txt etc and they will always just overwrite the existing readme.txt file on the server.
Here's what the basic of the current script:
<%
strFolder = Request.querystring("dest"
strPath = server.mappath(strFolder)
Set Upload = Server.CreateObject("Persits.Upload.1"
Count = Upload.Save(strPath)
%>
<HTML>
<BODY BGcolor="#000000" vlink="#FFFFFF" alink="#FFFFFF" link="#FFFFFF">
<center><b><font color="#FFFFFF">
<% = Count %> files uploaded successfully! </b></font><br><br>
<a href="uploadform.asp">Back to upload form</a>
</center>
</BODY>
</HTML>
Now I've been trying the file.Move way of doing it which should work, but I keep getting an Object required error on the line referring to file.Move:
<%
...
Set Upload = Server.CreateObject("Persits.Upload.1"
Count = Upload.Save(strPath)
file.Move strPath & "/read.txt"
...
%>
I've tried various combinations of this and it's just not having any of it. I think it's probably blatantly obvious, but I can't see what I'm doing wrong. Any ideas anyone!?
Thanks a lot in advance!