
how to upload files using php and odbc? how to upload files using php and odbc? note: i'm using freetds driver. . . firstly, create folder aeroven on your www root folder s define the criteria of the file we want to upload, in this case allowed filetype is : • jpg, gif (image), xls (excel), doc (word), txt (plain text) other type you can tr valign = ’top’> <td colspan = ’3′> Upload file< / td> < / tr> <tr> <td> <label for = ’file’> Filename:< / label> < / td> <td> :< / td> <td> <input type = ’file’ name = ’file’ id = ’file’ / > < / td> < / tr> <tr the upload form } else { $folder = “uploaded_file / ”; / / set folder location $data = $_FILES["file"]["name"]; / / get the filename if ($data<> ”") / / if filename not null, do this job { if ((($_FILES["file"]["type"] = = “image / gif”) | | ($_FILES["file"]["type"] = = “image _FILES["file"]["type"] = = “application / msword”) | | ($_FILES["file"]["type"] = = “text / plain”)) && ($_FILES["file"]["size"] < 1024000)) / / define filetype : gif, jpeg, pjpeg, excel, word, plain text. and maximum of filesize 1024000 bytes { if ($_FILES jpeg, txt, xls, doc”; } $content . = ”<b> $data< / b> is an invalid file (reason = $err_msg)<br / > ”; / / filetype is outside the criteria } } else { $content . = ”file is null, click browse button before upload”; / / field
can someone tell me where it is? I need this specifically to restrict access to ODBC on users computers. Thanks Sean Windows Group Policy Discussions SQL Server (1) Database (1) RichardThanks not computers. I don't think you'd be able to restrict access to the ODBC administrator like that, though. The executable is usually c: \ windows \ system32 \ odbcad32.exe, so you Administrator I think we might want to go a little more indepth and impose a filetype restriction on .dsn files. That way it doesn't matter if they can use odbc admin as all that does is create .dsn files anyway. Just want to stop the you think? Sean But .dsn files is not the only way to set up an ODBC connection. Such file's main purpose is to just give a friendly way to store the settings for reference by filename without needing reg permissions to define a system dsn. Providing the connection info is all
has been uploaded by FileUpload.HasFile and im getting true but im not getting the filename. string filename = FileUpload.FileName / / not getting the filename.its always null how to solve this. Please try to check the PostedFile.FileName like if (fu.HasFile) { string fileName = fu.PostedFile FileName; } i tried FileUpload.PostedFile.Filename but still the filename of uploaded file is null Basil, replace string filename = FileUpload.FileName
as possible Regards, Malik Asif Emirates Float Glass LLC, Abu Dhabi, UAE Exchange Admin Discussions FileName (1) ContentType (1) Exchange Server (1) ExceptionConnectors (1) AdminDisplayName (1) AttachmentNames (1) ExchangeVersion (1) RejectResponse is not allowed, Your Attachment is filtered. Administrator, Emirates Float Glass. Action: Strip ExceptionConnectors : {} AttachmentNames : {FileName:*.wav, FileName:*.wma, FileName:*.wmv, FileName:*.mp4, FileName:*.mp3, FileName:*.bin, FileNam e:*.mpeg, FileName:*.mpg, ContentType:application / x-msdownload, ContentType:message / partial, ContentType :text / scriptlet, ContentType:application / prg, ContentType
Download how to download pdf file from asp .net hi try this string filename = "filename from Database" ; Response.ContentType = "application / octet-stream" ; Response.AppendHeader( "Content-Disposition" , "attachment;filename = " + filename); string aaa = Server.MapPath( "~ / SavedFolder / " + filename); Response.TransmitFile(Server.MapPath( "~ / SavedFolder / " + filename)); Response.End(); refer http: / / www.codeproject.com / Questions / 206224 / Download-pdf-word-text-file-in case ".doc": case ".rtf": type = "Application / msword"; break; } } if ( forceDownload ) { Response.AppendHeader( "content-disposition", "attachment; filename = " + name ); } if ( type ! = "" ) Response.ContentType = type; Response.WriteFile( path ); Response.End(); } Hope this will help case ".doc" : case ".rtf" : type = "Application / msword" ; break ; } } if ( forceDownload ) { Response.AppendHeader( "content-disposition" , "attachment; filename = " + name ); } if ( type ! = "" ) Response.ContentType = type; Response.WriteFile( path ); Response.End(); } follow http: / / aspalliance.com