I've searched and read the links, but I still dont' get it, think I'm missing something obvious. Just trying to upload a file.
Put a HTML File Field on my page, set the id to "inputFile". Put a Web Forms button on the page, and trying this in the code:
Of course the code behind does not recognize "inputFile". All the examples I've seen actually put the code in the page, and not in the code behind. Is that how you have to do it? One link I read from Code Project said I should have something like this in my code, which I don't seeCode:inputFile.PostedFile.SaveAs(@"c:\temp\uploadedFile.xml");
Of course if I try to put that in manually (named inputFile) I get an object reference not set to instance error.Code:protected HtmlInputFile filMyFile;
Am I missing some hook? Or do I have to put the code in the page and not the code behind?
Thanks,
Mike




Reply With Quote