Click here to Skip to main content
15,896,557 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Problem in Combo Box? Pin
Phil Osborne13-Nov-07 6:15
Phil Osborne13-Nov-07 6:15 
GeneralRe: Problem in Combo Box? Pin
Pete O'Hanlon13-Nov-07 22:17
mvePete O'Hanlon13-Nov-07 22:17 
QuestionDrag & Drop DIV using JavaScript Pin
Jay Bhagatwala12-Nov-07 0:17
Jay Bhagatwala12-Nov-07 0:17 
AnswerRe: Drag & Drop DIV using JavaScript Pin
Michael Sync12-Nov-07 2:01
Michael Sync12-Nov-07 2:01 
Questionignoring file extension [modified] Pin
Sunil Wise12-Nov-07 0:12
professionalSunil Wise12-Nov-07 0:12 
AnswerRe: ignoring file extension Pin
John-ph12-Nov-07 0:34
John-ph12-Nov-07 0:34 
GeneralRe: ignoring file extension Pin
Sunil Wise12-Nov-07 0:56
professionalSunil Wise12-Nov-07 0:56 
GeneralRe: ignoring file extension Pin
John-ph12-Nov-07 1:39
John-ph12-Nov-07 1:39 
I guess you are trying to access the Extension property for the source file Name of the FileInfo Object before loading the file. the below given code works fine in my system without giving the extension of the new name. When you give the original file name, you need to specify the extension at the input stage. If the file-type is fixed then you hard-code it or pass the extension as a parameter.

FileInfo TheFile = 
new FileInfo(Server.MapPath(".") + "\\" + txtOldFile.Text); 
    if (TheFile.Exists) { 
        File.Copy(MapPath(".") + "\\" + txtOldFile.Text, 
MapPath(".") + "\\" + txtNewFile.Text + TheFile.Extension); 
    } 
    else { 
        throw new FileNotFoundException(); 
    } 


 Regards
 - J O H N -



GeneralRe: ignoring file extension Pin
Sunil Wise12-Nov-07 2:02
professionalSunil Wise12-Nov-07 2:02 
GeneralRe: ignoring file extension Pin
John-ph12-Nov-07 2:07
John-ph12-Nov-07 2:07 
Questionweb.config Pin
BasharatAli11-Nov-07 23:27
BasharatAli11-Nov-07 23:27 
AnswerRe: web.config Pin
John-ph11-Nov-07 23:44
John-ph11-Nov-07 23:44 
GeneralRe: web.config Pin
BasharatAli11-Nov-07 23:56
BasharatAli11-Nov-07 23:56 
GeneralRe: web.config Pin
John-ph12-Nov-07 0:05
John-ph12-Nov-07 0:05 
GeneralRe: web.config Pin
BasharatAli12-Nov-07 0:07
BasharatAli12-Nov-07 0:07 
GeneralRe: web.config Pin
John-ph12-Nov-07 0:12
John-ph12-Nov-07 0:12 
GeneralRe: web.config Pin
Paddy Boyd12-Nov-07 0:35
Paddy Boyd12-Nov-07 0:35 
GeneralRe: web.config Pin
BasharatAli12-Nov-07 0:58
BasharatAli12-Nov-07 0:58 
GeneralRe: web.config Pin
Paddy Boyd12-Nov-07 1:02
Paddy Boyd12-Nov-07 1:02 
GeneralRe: web.config Pin
Guffa12-Nov-07 1:47
Guffa12-Nov-07 1:47 
GeneralRe: web.config Pin
BasharatAli12-Nov-07 1:56
BasharatAli12-Nov-07 1:56 
GeneralRe: web.config Pin
John-ph12-Nov-07 2:38
John-ph12-Nov-07 2:38 
GeneralRe: web.config Pin
Guffa12-Nov-07 5:19
Guffa12-Nov-07 5:19 
GeneralRe: web.config Pin
BasharatAli12-Nov-07 17:18
BasharatAli12-Nov-07 17:18 
GeneralRe: web.config Pin
BasharatAli12-Nov-07 17:20
BasharatAli12-Nov-07 17:20 

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.