The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

How create page for uploading files RRS feed

  • Question

  • Hello, please help me. I need use BackgroundFileTransfer to upload large files. How I create PHP or ASP page for saving files? This example dont work for me -

    and other example I did not find it.

    Sunday, January 12, 2014 5:24 PM

All replies

  • I already have a solution:

     protected void Page_Load(object sender, EventArgs e)
                string path = "path";
                FileStream writeStream = new FileStream(path, FileMode.Create, FileAccess.Write);

                ReadWriteStream(Request.InputStream, writeStream);


            private void ReadWriteStream(Stream readStream, Stream writeStream)
                int Length = 256;
                Byte[] buffer = new Byte[Length];
                int bytesRead = readStream.Read(buffer, 0, Length);
                // write the required bytes 
                while (bytesRead > 0)
                    writeStream.Write(buffer, 0, bytesRead);
                    bytesRead = readStream.Read(buffer, 0, Length);

    Thank you.. :)

    Sunday, January 12, 2014 9:04 PM