--- parser3/src/main/pa_request.C 2010/11/22 22:24:23 1.325 +++ parser3/src/main/pa_request.C 2011/11/11 23:36:04 1.327 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_REQUEST_C="$Date: 2010/11/22 22:24:23 $"; +static const char * const IDENT_REQUEST_C="$Date: 2011/11/11 23:36:04 $"; #include "pa_sapi.h" #include "pa_common.h" @@ -568,6 +568,11 @@ void Request::use_file(VStateless_class& const String& file_name, const String* use_filespec/*absolute*/) { + if(file_name.is_empty()) + throw Exception(PARSER_RUNTIME, + 0, + "usage failed - no filename was specified"); + const String* filespec=0; if(file_name.first_char()=='/') //absolute path? [no need to scan MAIN:CLASS_PATH] @@ -846,7 +851,7 @@ void Request::output_result(VFile* body_ name_cstr=after_slash; if(char *after_slash=rsplit(name_cstr, '/')) name_cstr=after_slash; - vfile_name=new VString(*new String(name_cstr)); + vfile_name=new VString(*new String(name_cstr)); } } if(vfile_name) { @@ -855,7 +860,7 @@ void Request::output_result(VFile* body_ VHash& hash=*new VHash(); HashStringValue &h=hash.hash(); h.put(value_name, new VString( as_attachment ? content_disposition_attachment : content_disposition_inline )); - h.put(content_disposition_filename_name, vfile_name); + h.put(content_disposition_filename_name, new VString(String(sfile_name, String::L_HTTP_HEADER))); response.fields().put(content_disposition, &hash);