Re: How to check if uploaded file is binary or ascii?




veg_all@xxxxxxxxx wrote:
I have a script where a user can upload their csv file into a mysql
database. The problem is sometimes a user will upload the raw excel or
access file. How can I perform some simple checks to determine if the
file is binary. I could do some regular expressions to check for
unusual characters, but how would I read the file line by line?

Just look for \x00. Binary files would inevitable have it.

.



Relevant Pages

  • Re: How to check if uploaded file is binary or ascii?
    ... database. ... The problem is sometimes a user will upload the raw excel or ... access file. ...
    (comp.lang.php)
  • Re: UUdecode
    ... Dennis Boone wrote: ... Limited testing, so check results carefully. ... This *ONLY* works with BINARY files. ... I've got some source code I'd like to upload. ...
    (comp.sys.prime)
  • Re: OT What is a good way to upload a file to Usenet
    ... Is there a place to upload a file and post the link on Usenet? ... the web site to get to the PDF file. ... First off you might want to get a proper newsreader, ... you should know that binary files are ...
    (news.software.readers)
  • Another File Upload question
    ... the trouble that it comes when uploading large binary files to a DB ... server or server path. ... This way I could warn the users not to upload files ...
    (microsoft.public.dotnet.framework.aspnet)
  • How do you upload to binary newsgroups?
    ... Which programs do you use to prepare the binary files to upload them to ... a newsserver and which also create the PAR files? ...
    (rec.music.classical.recordings)