locked
Multiple file upload in to sql server RRS feed

  • Question

  • User1098076058 posted

    hi

    I REALLY NEED HELP FOR UPLOADING MORE THAN 500 PDF FILES IN TO SQL SERVER IN SIGLE SELECTION FROM FOLDER. I WANT INDIVIDUAL FILE TO SAVE SQL SERVER WITH FILENAME IN 1 COLUMN AND SAVE FILE IN DIFFERENT COLUMN.

    I KNOW I NEED SOME SORT OF PLUGIN THAT LOAD ALL FILE TO FORM IN SINGLE SELECTION LIKE GMAIL ATTACHMENT SELECTION OR FACEBOOK ALBUM UPLOAD SELECTION.

    PLEASE HELP ME WITH ANY SORT OF SAMPLE, PLUGIN, DOCUMENTS OR ARTICLE...

     

    THANKS

    Wednesday, May 2, 2012 10:59 AM

Answers

  • User1771049139 posted

    Hi!

    See the following URL for your solution :

    Upload Multiple Files in ASP.NET using jQuery

    This article will demonstrate how to Upload multiple files in ASP.NET using jQuery and ‘jQuery Multiple File Upload Plugin’.

    Regards.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 2, 2012 11:27 AM
  • User1954304945 posted

    Hi, I think it is better to save the file path to Database rather than save themselves. When you need to access the files, you can get the file path from Database and access them. You can refer to the following codes to store the file paths to Database.

    protected void Page_Load(object sender, EventArgs e)
            {
                string path = @"Your directory here";
                GetFiles(path);
            }
    
            public void GetFiles(string path)
            {
                if (Directory.Exists(path))
                {
                    ProcessDirectory(path);
                }
            }
    
            public void ProcessDirectory(string targetDirectory)
            {
                string[] fileEntries = Directory.GetFiles(targetDirectory);
                foreach (string fileName in fileEntries)
                {
                    /*
                     *  Your sql sentence here to store the file paths.
                     */
                }
                string[] subdirectoryEntries = Directory.GetDirectories(targetDirectory);
                foreach (string subdirectory in subdirectoryEntries)
                    ProcessDirectory(subdirectory);
            }
    

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 3, 2012 10:21 PM

All replies

  • User1771049139 posted

    Hi!

    See the following URL for your solution :

    Upload Multiple Files in ASP.NET using jQuery

    This article will demonstrate how to Upload multiple files in ASP.NET using jQuery and ‘jQuery Multiple File Upload Plugin’.

    Regards.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 2, 2012 11:27 AM
  • User1954304945 posted

    Hi, I think it is better to save the file path to Database rather than save themselves. When you need to access the files, you can get the file path from Database and access them. You can refer to the following codes to store the file paths to Database.

    protected void Page_Load(object sender, EventArgs e)
            {
                string path = @"Your directory here";
                GetFiles(path);
            }
    
            public void GetFiles(string path)
            {
                if (Directory.Exists(path))
                {
                    ProcessDirectory(path);
                }
            }
    
            public void ProcessDirectory(string targetDirectory)
            {
                string[] fileEntries = Directory.GetFiles(targetDirectory);
                foreach (string fileName in fileEntries)
                {
                    /*
                     *  Your sql sentence here to store the file paths.
                     */
                }
                string[] subdirectoryEntries = Directory.GetDirectories(targetDirectory);
                foreach (string subdirectory in subdirectoryEntries)
                    ProcessDirectory(subdirectory);
            }
    

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 3, 2012 10:21 PM