Class for packaging IO
Exemplo n.º 1
0
 /// <summary>
 /// uploads a file to the provider container
 /// </summary>
 /// <param name="FileStream">the file stream of the file being uploaded</param>
 /// <param name="FileName">the file name</param>
 /// <param name="BaseDirectory">the directory object that is the owner</param>
 /// <param name="Overwrite">boolean wether to overwrite the file if it exists.</param>
 /// <returns>the new file object</returns>
 public static FileSystem.File UploadFile(System.IO.Stream FileStream, string FileName, FileSystem.Directory BaseDirectory, bool Overwrite)
 {
     System.IO.MemoryStream ms = new System.IO.MemoryStream();
     FileStream.CopyTo(ms);
     FileStream.Close();
     byte[] binary = ms.ToArray();
     ms.Close();
     return FileSystemProvider.UploadFile(binary, FileName, BaseDirectory, Overwrite);
 }
Exemplo n.º 2
0
 /// <summary>
 /// uploads a file to the provider container
 /// </summary>
 /// <param name="FileBinary">the contents of the file as a byte array</param>
 /// <param name="FileName">the file name</param>
 /// <param name="BaseDirectory">the directory object that is the owner</param>
 /// <param name="Overwrite">boolean wether to overwrite the file if it exists.</param>
 /// <returns>the new file object</returns>
 public static FileSystem.File UploadFile(byte[] FileBinary, string FileName, FileSystem.Directory BaseDirectory, bool Overwrite)
 {
     return FileSystemProvider.UploadFile(FileBinary, FileName, BaseDirectory, Overwrite);
 }
Exemplo n.º 3
0
 /// <summary>
 /// uploads a file to the provider container
 /// </summary>
 /// <param name="FileStream">the file stream of the file being uploaded</param>
 /// <param name="FileName">the file name</param>
 /// <param name="BaseDirectory">the directory object that is the owner</param>
 /// <returns>the new file object</returns>
 public static FileSystem.File UploadFile(System.IO.Stream FileStream, string FileName, FileSystem.Directory BaseDirectory)
 {
     return UploadFile(FileStream, FileName, BaseDirectory, false);
 }
Exemplo n.º 4
0
        public static FileSystem.File UploadImage(System.IO.MemoryStream FileStream, string FileName, FileSystem.Directory BaseDirectory, bool Overwrite)
        {

            byte[] binary = FileStream.ToArray();
            FileStream.Close();
            return FileSystemProvider.UploadFile(binary, FileName, BaseDirectory, Overwrite);
        }