File upload problem
am 05.01.2007 12:01:55 von PW
I'm writing a small system to allow users to upload documents to my server.
I'm using Persist AspUpload for this. I have 2 ASP files.
In the first ASP file I prompt the user for a file description and a
filename, like this ...
In the 2nd ASP, which is the - ACTION="sl_upload2.asp" - file, I simply
perform the upload, like this ...
<%
Response.Write ""
Response.Write "St Lukes After School Care"
Response.Write ""
Set Upload = Server.CreateObject("Persits.Upload")
intCount = Upload.Save("C:/INETPUB/WWWROOT/SLASC/UPLOADS")
Response.Write "The file(s) have been stored successfully."
Response.Write ""
Response.Write ""
%>
No matter what I try (Get/Post/etc) I cannot get the DOCDESC and DOCFILE
values to pass through to the 2nd ASP file.
What can I do ?
Thanks,
PW
Re: File upload problem
am 05.01.2007 14:37:04 von Tim Slattery
"PW" wrote:
><%
>Response.Write ""
>Response.Write "St Lukes After School Care"
>Response.Write ""
>
>Set Upload = Server.CreateObject("Persits.Upload")
>intCount = Upload.Save("C:/INETPUB/WWWROOT/SLASC/UPLOADS")
>
>Response.Write "The file(s) have been stored successfully."
>Response.Write ""
>Response.Write ""
>%>
>
>
>No matter what I try (Get/Post/etc) I cannot get the DOCDESC and DOCFILE
>values to pass through to the 2nd ASP file.
They won't be in the Form collection or the Request collection, where
you would otherwise expect to find them, because you've specified
ENCTYPE="multipart/form-data", as you must to upload the file.
DOCDESC and DOCFILE will be sent along with the file in a
MIME-formatted data stream. I don't know anything about Persits
Upload, but it should have some way to let you access these things.
--
Tim Slattery
MS MVP(DTS)
Slattery_T@bls.gov
http://members.cox.net/slatteryt
Re: File upload problem
am 05.01.2007 14:37:04 von Tim Slattery
"PW" wrote:
><%
>Response.Write ""
>Response.Write "St Lukes After School Care"
>Response.Write ""
>
>Set Upload = Server.CreateObject("Persits.Upload")
>intCount = Upload.Save("C:/INETPUB/WWWROOT/SLASC/UPLOADS")
>
>Response.Write "The file(s) have been stored successfully."
>Response.Write ""
>Response.Write ""
>%>
>
>
>No matter what I try (Get/Post/etc) I cannot get the DOCDESC and DOCFILE
>values to pass through to the 2nd ASP file.
They won't be in the Form collection or the Request collection, where
you would otherwise expect to find them, because you've specified
ENCTYPE="multipart/form-data", as you must to upload the file.
DOCDESC and DOCFILE will be sent along with the file in a
MIME-formatted data stream. I don't know anything about Persits
Upload, but it should have some way to let you access these things.
--
Tim Slattery
MS MVP(DTS)
Slattery_T@bls.gov
http://members.cox.net/slatteryt
Re: File upload problem
am 05.01.2007 15:32:12 von 9ntw9
Set objUpload = Server.CreateObject("Persits.Upload")
For Each Item in objUpload.Form
...............
Next
Tim Slattery wrote:
> "PW" wrote:
>
> ><%
> >Response.Write ""
> >Response.Write "St Lukes After School Care"
> >Response.Write ""
> >
> >Set Upload = Server.CreateObject("Persits.Upload")
> >intCount = Upload.Save("C:/INETPUB/WWWROOT/SLASC/UPLOADS")
> >
> >Response.Write "The file(s) have been stored successfully."
> >Response.Write ""
> >Response.Write ""
> >%>
> >
> >
> >No matter what I try (Get/Post/etc) I cannot get the DOCDESC and DOCFILE
> >values to pass through to the 2nd ASP file.
>
> They won't be in the Form collection or the Request collection, where
> you would otherwise expect to find them, because you've specified
> ENCTYPE="multipart/form-data", as you must to upload the file.
>
> DOCDESC and DOCFILE will be sent along with the file in a
> MIME-formatted data stream. I don't know anything about Persits
> Upload, but it should have some way to let you access these things.
>
> --
> Tim Slattery
> MS MVP(DTS)
> Slattery_T@bls.gov
> http://members.cox.net/slatteryt
Re: File upload problem
am 05.01.2007 15:32:12 von 9ntw9
Set objUpload = Server.CreateObject("Persits.Upload")
For Each Item in objUpload.Form
...............
Next
Tim Slattery wrote:
> "PW" wrote:
>
> ><%
> >Response.Write ""
> >Response.Write "St Lukes After School Care"
> >Response.Write ""
> >
> >Set Upload = Server.CreateObject("Persits.Upload")
> >intCount = Upload.Save("C:/INETPUB/WWWROOT/SLASC/UPLOADS")
> >
> >Response.Write "The file(s) have been stored successfully."
> >Response.Write ""
> >Response.Write ""
> >%>
> >
> >
> >No matter what I try (Get/Post/etc) I cannot get the DOCDESC and DOCFILE
> >values to pass through to the 2nd ASP file.
>
> They won't be in the Form collection or the Request collection, where
> you would otherwise expect to find them, because you've specified
> ENCTYPE="multipart/form-data", as you must to upload the file.
>
> DOCDESC and DOCFILE will be sent along with the file in a
> MIME-formatted data stream. I don't know anything about Persits
> Upload, but it should have some way to let you access these things.
>
> --
> Tim Slattery
> MS MVP(DTS)
> Slattery_T@bls.gov
> http://members.cox.net/slatteryt
Re: File upload problem
am 05.01.2007 22:48:16 von PW
I have added some lines to the program to display the values I want.
DOCDESC is now coming through, but not DOCFILE.
<%
Response.Write ""
Response.Write "
St Lukes After School Care"
Response.Write ""
Set Upload = Server.CreateObject("Persits.Upload")
intCount = Upload.Save("C:/INETPUB/WWWROOT/SLASC/UPLOADS")
Response.Write "The file(s) have been stored successfully."
myDOCDESC = Upload.Form("DOCDESC")
myDOCFILE = Upload.Form("DOCFILE")
Response.Write myDOCDESC
Response.Write myDOCFILE
Response.Write ""
Response.Write ""
%>
Re: File upload problem
am 05.01.2007 22:48:16 von PW
I have added some lines to the program to display the values I want.
DOCDESC is now coming through, but not DOCFILE.
<%
Response.Write ""
Response.Write "
St Lukes After School Care"
Response.Write ""
Set Upload = Server.CreateObject("Persits.Upload")
intCount = Upload.Save("C:/INETPUB/WWWROOT/SLASC/UPLOADS")
Response.Write "The file(s) have been stored successfully."
myDOCDESC = Upload.Form("DOCDESC")
myDOCFILE = Upload.Form("DOCFILE")
Response.Write myDOCDESC
Response.Write myDOCFILE
Response.Write ""
Response.Write ""
%>
Re: File upload problem
am 06.01.2007 23:33:54 von PW
I've sorted it out now. Thanks for your help everyone ! :-)
Re: File upload problem
am 06.01.2007 23:33:54 von PW
I've sorted it out now. Thanks for your help everyone ! :-)