Click here to Skip to main content
15,881,600 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: How to use treeView to save the directory tree into the SQL Server database ? Pin
Richard MacCutchan9-Jun-19 21:49
mveRichard MacCutchan9-Jun-19 21:49 
QuestionMysterious ADFS problem Pin
Super Lloyd5-Jun-19 21:19
Super Lloyd5-Jun-19 21:19 
Questionweb form needs to be used for several languages Pin
dcof2-Jun-19 19:46
dcof2-Jun-19 19:46 
AnswerRe: web form needs to be used for several languages Pin
F-ES Sitecore3-Jun-19 1:00
professionalF-ES Sitecore3-Jun-19 1:00 
Question(SOLVED) Is it possible to raise an error on filename that resides on the server? Pin
samflex29-May-19 4:36
samflex29-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
samflex29-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 
Some code to test whether the specified file exists. Smile | :)

Assuming your files are stored somewhere that's accessible to the current site, the simplest solution would be to add a virtual directory under App_Data, and then use something like:
C#
protected bool RecordingExists(string filename, string servername)
{
    string virtualPath = string.Format("~/App_Data/YourVirtualDirectory/{1}/noop_{0}.wav", filename, servername);
    string physicalPath = Server.MapPath(virtualPath);
    return System.IO.File.Exists(physicalPath);
}

Adding the virtual directory under App_Data will ensure that users can't access the files directly by navigating to them; they will have to use the "play_recording" page.



"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
samflex30-May-19 4:00
samflex30-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
samflex31-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 
GeneralRe: Is it possible to raise an error on filename that resides on the server? Pin
samflex31-May-19 3:42
samflex31-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
samflex31-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
samflex31-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
samflex31-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
samflex31-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
Member 1447264927-May-19 20:07 
AnswerRe: asp.net Pin
phil.o27-May-19 20:17
professionalphil.o27-May-19 20:17 

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.