Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 456989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:31:33+00:00 2026-05-12T22:31:33+00:00

I am trying to implement the checkscript feature of uploadify in an asp.net mvc

  • 0

I am trying to implement the checkscript feature of uploadify in an asp.net mvc view but i can’t determine what the key is i should be using on the controller side. Below is the php script but i am not very familiar with php and can’t determine what php is scraping out of the httprequest. Has anyone implemented this? The documentation is a little sparse (as in nonexistent).

$fileArray = array();
foreach ($_POST as $key => $value) {
    if ($key != 'folder') {
        if (file_exists($_SERVER['DOCUMENT_ROOT'] . $_POST['folder'] . '/' . $value)) {
            $fileArray[$key] = $value;
        }
    }
}
echo json_encode($fileArray);
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T22:31:33+00:00Added an answer on May 12, 2026 at 10:31 pm

    Here is the solution for anyone searching. Basically the uploadify script sends the file names and a unique key it generates in the forms collection. You can get at it by iterating through allkeys. The controller action below iterates through the form allkeys collection and if the key is not folder (uploadify folder parameter is also passed in the formscollection for scriptCheck) it checks to see if the file already exists. If it does exist the key and value are added to a dictionary which is then returned to the client. The uploadify plugin will then alert the user that the file exists and give them an opportunity to cancel the upload. Hope this helps someone else out.

    public ActionResult FileExists(FormCollection forms)
        {
            Dictionary<string,string> fileArray = new Dictionary<string,string>();
    
            foreach (string key in forms.AllKeys)
            {
                if (key != "folder")
                {
                    string targetDirectory = Path.Combine(Request.PhysicalApplicationPath, @"uploads\documents\");
                    string targetFilePath = Path.Combine(targetDirectory, forms[key]);
                    if (System.IO.File.Exists(targetFilePath)) fileArray.Add(key, forms[key]);
                }
            }
    
            return Json(fileArray);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying implement a bracket in my program (using C#/.NET MVC) and I am
I'm trying to implement a view tracking web service on my website. I'm using
am trying to implement fluent nhibernate in MVC project...there were no build errors... but
Trying to implement Piwik using REST API over http but need a little help.
trying to implement a dialog-box style behaviour using a separate div section with all
While trying to implement an MVC file upload example on Scott Hanselman's blog. I
I trying to implement the active record pattern using Java/JDBC and MySQL along with
Iam trying to implement a simple JMS(traditional not using springs) code in eclipse using
Trying to implement search with Sunspot Gem wich is using Solr.Fulltext search works fine
Trying to implement a modal window with CCLayer. My modal view layer is added

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.