Click here to Skip to main content
14,333,124 members
   

ASP.NET

 
Question(SOLVED) Is it possible to raise an error on filename that resides on the server? Pin
samflex29-May-19 4:36
membersamflex29-May-19 4:36 
AnswerRe: Is it possible to raise an error on filename that resides on the server? Pin
Richard Deeming29-May-19 7:16
mveRichard Deeming29-May-19 7:16 
GeneralRe: Is it possible to raise an error on filename that resides on the server? Pin
samflex29-May-19 9:18
membersamflex29-May-19 9:18 
GeneralRe: Is it possible to raise an error on filename that resides on the server? Pin
Richard Deeming30-May-19 0:16
mveRichard Deeming30-May-19 0:16 
GeneralRe: Is it possible to raise an error on filename that resides on the server? Pin
samflex30-May-19 4:00
membersamflex30-May-19 4:00 
GeneralRe: Is it possible to raise an error on filename that resides on the server? Pin
Richard Deeming30-May-19 7:31
mveRichard Deeming30-May-19 7:31 
GeneralRe: Is it possible to raise an error on filename that resides on the server? Pin
samflex31-May-19 3:17
membersamflex31-May-19 3:17 
GeneralRe: Is it possible to raise an error on filename that resides on the server? Pin
Richard Deeming31-May-19 3:26
mveRichard Deeming31-May-19 3:26 
That doesn't seem to match the link from your original question:
http://Archive/{servername}/play_recording_wav.aspx?filename=noop_{filename}.wav

You now seem to be navigating directly to the audio file, using a web server on it-server1. Is that the same server that your code is running on?

Assuming it is the same server, then you'd want something like this:
protected bool RecordingExists(string filename, string servername)
{
    string virtualPath = string.Format("/archives/{1}/{0}.wav", filename, servername);
    string physicalPath = Server.MapPath(virtualPath);
    return System.IO.File.Exists(physicalPath);
}




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: Is it possible to raise an error on filename that resides on the server? Pin
samflex31-May-19 3:42
membersamflex31-May-19 3:42 
GeneralRe: Is it possible to raise an error on filename that resides on the server? Pin
Richard Deeming31-May-19 3:50
mveRichard Deeming31-May-19 3:50 
GeneralRe: Is it possible to raise an error on filename that resides on the server? Pin
samflex31-May-19 4:19
membersamflex31-May-19 4:19 
GeneralRe: Is it possible to raise an error on filename that resides on the server? Pin
Richard Deeming31-May-19 4:33
mveRichard Deeming31-May-19 4:33 
GeneralRe: Is it possible to raise an error on filename that resides on the server? Pin
samflex31-May-19 4:36
membersamflex31-May-19 4:36 
GeneralRe: Is it possible to raise an error on filename that resides on the server? Pin
Richard Deeming31-May-19 5:19
mveRichard Deeming31-May-19 5:19 
GeneralRe: Is it possible to raise an error on filename that resides on the server? Pin
samflex31-May-19 6:07
membersamflex31-May-19 6:07 
GeneralRe: Is it possible to raise an error on filename that resides on the server? Pin
Richard Deeming31-May-19 6:20
mveRichard Deeming31-May-19 6:20 
GeneralRe: Is it possible to raise an error on filename that resides on the server? Pin
samflex31-May-19 6:29
membersamflex31-May-19 6:29 
QuestionHTTP Error 502.5 - Process Failure while publishing ASP.Net Core 2.1 Pin
meeram3927-May-19 20:45
professionalmeeram3927-May-19 20:45 
AnswerRe: HTTP Error 502.5 - Process Failure while publishing ASP.Net Core 2.1[RESOLVED] Pin
meeram3927-May-19 22:33
professionalmeeram3927-May-19 22:33 
Questionasp.net Pin
Member 1447264927-May-19 20:07
memberMember 1447264927-May-19 20:07 
AnswerRe: asp.net Pin
phil.o27-May-19 20:17
mvephil.o27-May-19 20:17 
QuestionExcel to MS SQL using ASP.net VB Pin
Member 1447166826-May-19 22:38
memberMember 1447166826-May-19 22:38 
AnswerRe: Excel to MS SQL using ASP.net VB Pin
Richard MacCutchan26-May-19 23:18
protectorRichard MacCutchan26-May-19 23:18 
Question(SOLVED) How do I get my link to point to server and play a .WAV audio? Pin
samflex23-May-19 6:17
membersamflex23-May-19 6:17 
AnswerRe: How do I get my link to point to server and play a .WAV audio? Pin
Richard Deeming23-May-19 7:24
mveRichard Deeming23-May-19 7:24 

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.