module to save file

  • Thread starter Thread starter JJ_377
  • Start date Start date
J

JJ_377

How would I use a module to save a file?

I can use the html input (type-file) in a webform to select a file and
then do a saveas on the request object's file.

However, I would like to be able to do this in a module, but the module
doesn't know anything about the request object in the webform.

In otherwords, I would like to pass the filename to a function in a
module and then the file is saved to a local drive by the function.

That way I can reuse the same function in the module to save other
files without rewriting the same code again.

Thank you very much.
 
System.Web.HttpContext.Current allows access to the current HTTP request.

Patrice
 
What I find is that I cannot reference the request object in a function
in a module; it doesn't seem to know anything about the request: only
the form in which I call the external function knows about the request
object....I need to be able to pass the filename to the external
function and then save it to somewhere...
 
I'm wrong: the System.IO.Path.GetFileName(Request.Files(0).FileName)
does reveal the file name in the external module...
Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top