Troubleshooting
Q: 上傳檔案傳完後response 404 not foundA: 除了檢查PHP.ini裡upload_max_filesize欄位外,IIS本身有限制request的maxAllowedContentLength。IIS設定方式 在左側樹狀圖中點選站點>右側功能檢視中點選"要求篩選">最右側動作點選"編輯功能設定">彈出視窗中的"允許的內容長度上限"欄位輸入新的限制數值。官方文件說預設只有28MB左右超過就會噴404
public sealed class Singleton
{
private static volatile Singleton instance;
private static object syncRoot = new Object();
private Singleton() {}
public static Singleton Instance
{
get
{
lock (syncRoot)
{
if (instance == null)
instance = new Singleton();
}
return instance;
}
}
}
正確寫法:public sealed class Singleton
{
private static volatile Singleton instance;
private static object syncRoot = new Object();
private Singleton() {}
public static Singleton Instance
{
get
{
if (instance == null)
{
lock (syncRoot)
{
if (instance == null)
instance = new Singleton();
}
}
return instance;
}
}
}
Comment: