Re: [PHP] Insert file into sql server binary field.

2002-11-25 Thread Marek Kilimajer
I would notice the difference, but computers don't understand text, it 
is just data for them,
and they represent it the same way (there is no special file type for 
text and binary in
filesystem either). The only difference is in case sensitivity - taken 
from mysql manual.
You can also store binary objects in text.

Chris Shiflett wrote:

--- Marek Kilimajer <[EMAIL PROTECTED]> wrote:

 

BLOB is like TEXT
   


In what way? BLOB is binary large object. Text is ... text. One is
binary, and the other is ASCII. The only similarity I can think of is
that they both represent data. However, the format is completely
different.

Open up a binary file in a text editor, and then do the same with a
regular text file. I think you will notice a significant difference.
Or, consider the representation of 16 in binary versus ASCII:

binary - 1
ascii - 0011000100110110

As Sterling mentioned, using addslashes() on binary data is a bad
idea. The same can be said for any string operations intended for
ASCII data.

Chris

 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Insert file into sql server binary field.

2002-11-24 Thread Chris Shiflett
--- Marek Kilimajer <[EMAIL PROTECTED]> wrote:

> BLOB is like TEXT

In what way? BLOB is binary large object. Text is ... text. One is
binary, and the other is ASCII. The only similarity I can think of is
that they both represent data. However, the format is completely
different.

Open up a binary file in a text editor, and then do the same with a
regular text file. I think you will notice a significant difference.
Or, consider the representation of 16 in binary versus ASCII:

binary - 1
ascii - 0011000100110110

As Sterling mentioned, using addslashes() on binary data is a bad
idea. The same can be said for any string operations intended for
ASCII data.

Chris

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Insert file into sql server binary field.

2002-11-24 Thread Marek Kilimajer
Never heard of that, in fact, addslashes escapes also NUL, so it must be 
binary,
and BLOB is like TEXT, except for comparison is case sensitive in BLOB.
And what if the file contains malicious code - it might come from remote 
user's upload

Sterling Hughes wrote:

Read the file, addslashes(), and then insert it

   

Rather, read the file, don't touch addslashes, then insert it.

AddSLashes is not for binary data...

-Sterling



 

Naif Al-Otaibi wrote:

   

How can I insert a file into a binary field in sql server 2000. Do I 
need some function in the query like upload or just read the file and 
insert it.

Thanks,



 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

   


 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Insert file into sql server binary field.

2002-11-24 Thread Sterling Hughes
> Read the file, addslashes(), and then insert it
>
Rather, read the file, don't touch addslashes, then insert it.

AddSLashes is not for binary data...

-Sterling



> Naif Al-Otaibi wrote:
> 
> >How can I insert a file into a binary field in sql server 2000. Do I 
> >need some function in the query like upload or just read the file and 
> >insert it.
> >
> >Thanks,
> >
> > 
> >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Insert file into sql server binary field.

2002-11-24 Thread Marek Kilimajer
Read the file, addslashes(), and then insert it

Naif Al-Otaibi wrote:


How can I insert a file into a binary field in sql server 2000. Do I 
need some function in the query like upload or just read the file and 
insert it.

Thanks,

 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Insert file into sql server binary field.

2002-11-23 Thread Naif Al-Otaibi

How can I insert a file into a binary field in sql server 2000. Do I 
need some function in the query like upload or just read the file and 
insert it.

Thanks,

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php