March 02, 2012

File Upload Control Explained

http://msdn.microsoft.com/en-us/library/ms454491.aspx

http://www.codeproject.com/Articles/20023/ASP-NET-2-0-FileUpload-Server-Control


if (FileUpload1.HasFile)
            {
                Hashtable reqProperties = new Hashtable();
                reqProperties.Add("vti_title", "Test");
                String fileToUpload = FileUpload1.PostedFile.FileName;
                String documentLibraryName = "Submissions";
                Stream fStream = FileUpload1.PostedFile.InputStream;
                byte[] contents = new byte[fStream.Length];
                SPFolder myLibrary = SPContext.Current.Web.Folders[documentLibraryName];
                SPFile spfile = myLibrary.Files.Add(FileUpload1.FileName, contents, reqProperties, true);
            }

No comments:

SonarQube with Jenkins Setup using Docker Images

https://funnelgarden.com/sonarqube-jenkins-docker/  https://medium.com/@hakdogan/an-end-to-end-tutorial-to-continuous-integration-and-con...