ユーザーが参照してアップロードボタンを押すファイルがあり、ファイルをサーバーに保存し、アプリケーションディレクトリに appdata/uploads を保存します。次に、ストリームリーダーを使用して読み取ってから解析しようとします。私のローカル開発環境では問題なく動作しますが、サーバーにデプロイするとまったく動作しません。助言がありますか??ありがとうございました
//Save LoadList File:
DateTime uploadDate = DateTime.Now;
string destinationPath = string.Format("{0}\\{1}\\{2}\\{3}\\", Server.MapPath("~/App_Data/uploads"), uploadDate.ToString("yyyy"), uploadDate.ToString("MMM"), uploadDate.ToString("dd"));
if (!Directory.Exists(destinationPath))
Directory.CreateDirectory(destinationPath);
string storedFileName = string.Format("{0}{1}.json", destinationPath, System.Guid.NewGuid());
file.ElementAt(0).SaveAs(storedFileName);
//FileImport is a static class
var Pair = FileImport.CyclesCompleted(storedFileName);
private static string LoadTextFromFile(string fileName)
{
StreamReader streamReader = new StreamReader(fileName);
string text = streamReader.ReadToEnd();
streamReader.Close();
return text;
}