Grant,
When you use the UploadFile method on the WebClient class, you can
then get to the uploaded file(s) by:
<%@ Import Namespace="System"%>
<%@ Import Namespace="System.IO"%>
<%@ Import Namespace="System.Net"%>
<%@ Import NameSpace="System.Web"%>
<Script language="C#" runat=server>
void Page_Load(object sender, EventArgs e) {
foreach(string f in Request.Files.AllKeys) {
HttpPostedFile file = Request.Files[f];
file.SaveAs("c:\\inetpub\\test\\UploadedFiles\\" +
file.FileName);
}
}
</Script>
<html>
<body>
<p> Upload complete. </p>
</body>
</html>
The Request has a Files collection that you use to get the uploaded
files. This is shown in the link you posted with the original message.
If this isn't what you were asking, please post some of your code so I
can help you further.
sayed
"Grant Harmeyer" <ne*@internetapollo.com> wrote in message news:<uG**************@TK2MSFTNGP15.phx.gbl>...
I was unaware that it needed to be a dynamic URL. That clears it up a bit.
Now, how would I take the array of bytes that is read in and then
re-construct the file on the server?
Thanks again,
Grant Harmeyer
"Sayed Hashimi" <ha***********@hotmail.com> wrote in message
news:3a**************************@posting.google.c om... What URL are you posting to? The url has to be a dynamic url. For
example,
You can't post to something like:
http://website.com/uploads/
The url has to be something like:
http://website.com/uploads/doupload.aspx
If you are aware of the above, then how large is the file. Your
machine.config file has a max on the length of uploaded files.
sayed
"Grant Harmeyer" <ne*@internetapollo.com> wrote in message
news:<#M**************@TK2MSFTNGP15.phx.gbl>... When I try to upload a file to a resource on my local webserver, my code
catches an exception that a 405 error (method not supported) has occured
on
the server. I set the code up nearly exactly as it is shown in the
following
link:
http://msdn.microsoft.com/library/de...dfiletopic.asp
The only thing I did differently is that I also set the BaseAddress
property
of the WebClient instance. I have tried using both of the overloaded
UploadFile() methods with the same results each time. Is there any really
good documentation out there on the use of the System.Net.WebClient
class?
TIA,
Grant Harmeyer