Beispiel #1
0
        public string UploadFile(Stream fileContents)
        {
            MultipartParser parser = new MultipartParser(fileContents);

            if (parser.Success)
            {
                int count = 0;
                foreach (MultipartParser.FileData singleFileData in parser.FileDataList)
                {
                    SaveFile("from_server_" + count.ToString() + "_" + singleFileData.Filename, singleFileData.ContentType, singleFileData.FileContents);
                    count++;
                }
            }


            //OldMultipartParser parser = new OldMultipartParser(fileContents);

            //if (parser.Success)
            //{
            //    // Save the file
            //    SaveFile(parser.Filename, parser.ContentType, parser.FileContents);
            //}

            return("");
        }
Beispiel #2
0
        public string UploadFile(Stream fileContents)
        {
            MultipartParser parser = new MultipartParser(fileContents);
            if (parser.Success)
            {
                int count = 0;
                foreach (MultipartParser.FileData singleFileData in parser.FileDataList)
                {
                    SaveFile("from_server_" + count.ToString() + "_" + singleFileData.Filename, singleFileData.ContentType, singleFileData.FileContents);
                    count++;
                }
            }

            //OldMultipartParser parser = new OldMultipartParser(fileContents);

            //if (parser.Success)
            //{
            //    // Save the file
            //    SaveFile(parser.Filename, parser.ContentType, parser.FileContents);
            //}

            return "";
        }