Closed Thread Icon

Topic awaiting preservation: php: upload file directly into mysql (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12079" title="Pages that link to Topic awaiting preservation: php: upload file directly into mysql (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: php: upload file directly into mysql <span class="small">(Page 1 of 1)</span>\

 
GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 03-02-2002 22:51

is there an easy possibility to store a file that was uploaded via input type=file directly into a mysql-db which is defined as BLOB?

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 03-02-2002 23:08

or what does
Warning: open_basedir restriction in effect. File is in wrong directory ....
mean when i do:
copy($uploadedfile, "./newfile.txt");

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 03-03-2002 00:59

open_basedir messages mean you don't have the rights to open the file in its current location. This is usually indicative of PHP running in Safe Mode. You can work around this if you have access to the .conf file. Check phpinfo and look for the safe_mode setting. If it's on, check the open_basedir setting. You can open files in any dir underneath what is listed.



[This message has been edited by Pugzly (edited 03-03-2002).]

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 03-03-2002 01:09

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 03-03-2002 01:31

pugzly, yes php is running in safe mode and i dont have access to the config files.

ini, what exactly do you mean?

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 03-03-2002 03:04

He means it's more work for the server to have your files in blobs of a DB. It's better (and less work on the server) to store the path to the file in the DB, and the file itself in just the file system.

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 03-03-2002 10:47

ah! i see.
btw, i got around the problem of storing by using move_uploaded_file().

thanks all.

lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 03-04-2002 08:02

to load a file directly into a blob field, use this:

insert into tablename(blobfield) values(load_file('/path/to/file.txt'))

« BackwardsOnwards »

Show Forum Drop Down Menu