Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Uploading and moving files not working as I expectUploading and moving files not working as I expect
Previous
 
Next
New Post
12/11/2009 1:49 PM
 

This is DNN 5.1.4.  I need to upload a file to my portal folder, rename it, and then work with the renamed file. It does not work as I expect. The file is not always uploaded, and moving the file to a new name never works.  The following is my logic :

public static string[] ArchiveUpload(
   PortalSettings portalSettings,
   HttpPostedFile sourceFile
   ) {
   string[] filePaths = new string[2];

   FolderInfo uploadFolderInfo = GetUploadFolder(portalSettings, DefaultFolderName);
   string sourceFileName = uploadFolderInfo.PhysicalPath + sourceFile.FileName;
   string archiveFileName = uploadFolderInfo.PhysicalPath + sourceFile.FileName + DateTime.Now.ToString(".yyyyMMddhhmmss");

   FileSystemUtils.UploadFile(
      uploadFolderInfo.PhysicalPath,
      sourceFile,
      false
      );
   FileSystemUtils.MoveFile(
      sourceFileName, archiveFileName,
      portalSettings
      );

   filePaths[0] = sourceFileName;
   filePaths[1] = archiveFileName;
   return filePaths;
}

It looks pretty straightforward to me. I don't need to register these files to DNN as database resources. Or do I? What am I doing wrong?

 

 
New Post
12/11/2009 2:56 PM
 

For now I'm using the System.IO.File.Move method - all works fine.  But I would like to understand if I am understanding and using the DNN MoveFile method completely. Thx again.

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Uploading and moving files not working as I expectUploading and moving files not working as I expect


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out