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

  • Home
  • SEARCH
  • 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 8099103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:17:37+00:00 2026-06-05T22:17:37+00:00

I have the following code that returns a .CSV file when a link is

  • 0

I have the following code that returns a .CSV file when a link is clicked for a user to save:

public FileContentResult DownloadCSV()
{
    StringBuilder sb = new StringBuilder();
    var props = typeof(PenCalcModel).GetProperties();
    var penSummary = PenSummaryReport(new DateTime(DateTime.Today.Ticks, DateTimeKind.Utc), new DateTime(DateTime.Today.AddDays(1).Ticks, DateTimeKind.Utc), "");

    foreach (PenCalcModel item in penSummary)
    {
        sb.Append(string.Join(",", props.Select(p=>p.GetValue(item,null).ToString())));
        sb.AppendLine();
    }

    return File(new System.Text.UTF8Encoding().GetBytes(sb.ToString()), "text/csv", "PenReport.csv");
}

Is there a way where I could set it up to have this exact same .CSV file exported from the server to a networked drive every X hours?

  • 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-06-05T22:17:39+00:00Added an answer on June 5, 2026 at 10:17 pm

    Having anything set as a scheduled task/job should not be the responsibility of a web app. The app could be recycled at any time and could even interrupt that job. Those kinds of implementations should be the responsibility of a windows service or some sort of task based job on the server. Short answer, don’t do this in the web app.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following piece of Java code that reads strings from CSV file.
I have the following code that returns HTTP error 400 everytime I try to
I have the following PHP code that returns a JSON object via Ajax to
I have the following code that returns a reference to an array with one
Lets say I have the following code that returns number of anchor elements on
I have the following code that returns at the end of some of my
I have the following code in a WCF Service that returns a string, and
I have the following code that returns rows from a database when a form
I have the following controller code that returns a Json list object to my
I currently have a function that takes a csv file, and returns an array

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.