Click here to Skip to main content
15,890,527 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How to implement a Treeview / Form interface. Pin
Wierdbeard6512-Sep-14 6:54
Wierdbeard6512-Sep-14 6:54 
QuestionNeed to POST xml data to web device w/ c# ASPX Pin
Member 110616635-Sep-14 5:36
Member 110616635-Sep-14 5:36 
QuestionAsp.net GridView with JQuery Pin
Member 106549793-Sep-14 20:41
Member 106549793-Sep-14 20:41 
QuestionRe: Asp.net GridView with JQuery Pin
ZurdoDev5-Sep-14 6:19
professionalZurdoDev5-Sep-14 6:19 
QuestionConverting Word document to HTML page Pin
meeram393-Sep-14 19:14
professionalmeeram393-Sep-14 19:14 
SuggestionRe: Converting Word document to HTML page Pin
Kornfeld Eliyahu Peter3-Sep-14 20:14
professionalKornfeld Eliyahu Peter3-Sep-14 20:14 
QuestionEncoding password sent to MVC web service reports vulnerability issues Pin
Stephen Holdorf3-Sep-14 8:22
Stephen Holdorf3-Sep-14 8:22 
QuestionAjax call Error when using FileStream in code Pin
pawan Jha19883-Sep-14 2:59
pawan Jha19883-Sep-14 2:59 
//string FileName = "";
string _fileName = FileName.Replace("?",@"\");
string fileType = Path.GetExtension(_fileName);

FileStream str = File.OpenRead(_fileName);
System.IO.BinaryReader r = new System.IO.BinaryReader(str);
string fileclass = "";
byte buffer;

str.Seek(0, SeekOrigin.Begin);
buffer = r.ReadByte();
fileclass = buffer.ToString();
buffer = r.ReadByte();
fileclass += buffer.ToString();

r.Close();

return Convert.ToString(SR_BAL_Common.MatchFileType(fileType.ToUpper(), fileclass.ToString()));



Ajax Method

$.ajax({
type: "POST",
url: _URL,
data: '{"FileName":"' + replaceableString + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
beforeSend: function () { },
complete: function () { },
error: function (xhr, desc, exceptionobj) { alert(xhr.responseText); },
success: function (Result, Status) {
alert(Result.d);
if (Result.d == "0") {
alert("Please select valid CV to upload. \nOnly .pdf, .doc, .docx, .html, .htm, .txt and .rtf files are allowed.");
return false;
}
}
});


The above code is working on Local but on server it giving error 500 will please suggest any why this error is coming.
Pawan Jha

AnswerRe: Ajax call Error when using FileStream in code Pin
Richard Deeming3-Sep-14 3:32
mveRichard Deeming3-Sep-14 3:32 
GeneralRe: Ajax call Error when using FileStream in code Pin
ZurdoDev3-Sep-14 3:36
professionalZurdoDev3-Sep-14 3:36 
GeneralRe: Ajax call Error when using FileStream in code Pin
pawan Jha19884-Sep-14 0:54
pawan Jha19884-Sep-14 0:54 
QuestionThe request failed with HTTP status 401: Unauthorized Pin
Member 101656822-Sep-14 2:38
Member 101656822-Sep-14 2:38 
AnswerRe: The request failed with HTTP status 401: Unauthorized Pin
Jameel VM2-Sep-14 3:41
Jameel VM2-Sep-14 3:41 
GeneralRe: The request failed with HTTP status 401: Unauthorized Pin
Member 101656822-Sep-14 20:07
Member 101656822-Sep-14 20:07 
SuggestionRe: The request failed with HTTP status 401: Unauthorized Pin
Richard Deeming3-Sep-14 1:44
mveRichard Deeming3-Sep-14 1:44 
AnswerRe: The request failed with HTTP status 401: Unauthorized Pin
Bernhard Hiller2-Sep-14 21:19
Bernhard Hiller2-Sep-14 21:19 
QuestionAsp .Net MVC ver 4 - Change standard css template Pin
Piotrekneo182-Sep-14 0:07
Piotrekneo182-Sep-14 0:07 
AnswerRe: Asp .Net MVC ver 4 - Change standard css template Pin
Jameel VM2-Sep-14 3:36
Jameel VM2-Sep-14 3:36 
GeneralRe: Asp .Net MVC ver 4 - Change standard css template Pin
Piotrekneo184-Sep-14 10:18
Piotrekneo184-Sep-14 10:18 
QuestionAsp.net Session state Pin
Otekpo Emmanuel1-Sep-14 19:20
Otekpo Emmanuel1-Sep-14 19:20 
QuestionRe: Asp.net Session state Pin
Kornfeld Eliyahu Peter1-Sep-14 20:52
professionalKornfeld Eliyahu Peter1-Sep-14 20:52 
AnswerRe: Asp.net Session state Pin
Richard Deeming2-Sep-14 1:37
mveRichard Deeming2-Sep-14 1:37 
GeneralRe: Asp.net Session state Pin
Otekpo Emmanuel2-Sep-14 4:01
Otekpo Emmanuel2-Sep-14 4:01 
AnswerRe: Asp.net Session state Pin
ZurdoDev2-Sep-14 2:13
professionalZurdoDev2-Sep-14 2:13 
GeneralRe: Asp.net Session state Pin
Otekpo Emmanuel2-Sep-14 3:57
Otekpo Emmanuel2-Sep-14 3:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.