RE: No data?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



That would be a php.ini setting and I have no clue which [context] to look for my friend.

 

 

 

From: tamouse mailing lists [mailto:tamouse.lists@xxxxxxxxx] 
Sent: Thursday, July 26, 2012 4:11 PM
To: Brad
Subject: RE:  No data?

 

I am sure the file is created. You need to look to see if MySQL can *read* the file. It *must* be world readable. Please look at permissions on *file* not directory.

On Jul 26, 2012 3:03 PM, "Brad" <nyctelecomm@xxxxxxxxx> wrote:

That is created via php. It would not create that filename of /tmp/thy152k (which becomes an actual file) unless it had the permissions.

An extensive hack could prove those but I am confident it is self explanatory.

 

 

Respectfully,
Brad

 

From: tamouse mailing lists [mailto:tamouse.lists@xxxxxxxxx] 
Sent: Thursday, July 26, 2012 1:13 PM
To: Brad
Subject: RE:  No data?

 

That shows that the /tmp directory is world rwx. What about the actual temp file? 

On Jul 26, 2012 5:05 AM, "Brad" <nyctelecomm@xxxxxxxxx> wrote:

My brain went there in a hurry, hours ago my friend
http://tinypic.com/r/28mrm/6

now you should see why I am so confused
No error, but no data either. :(

Brad Sumrall
NYCTelecomm.com
212 444-2996 <tel:212%20444-2996> 

-----Original Message-----
From: tamouse mailing lists [mailto:tamouse.lists@xxxxxxxxx]
Sent: Thursday, July 26, 2012 5:52 AM
To: Brad
Cc: php-db@xxxxxxxxxxxxx
Subject: Re:  No data?

In reading over LOAD DATA ... in the mysql reference. it makes particular note of the fact that the file it's reading must be completely world readable, including all paths to the file. In checking just now, I notice that a file uploaded by php and placed in /tmp is only readable by the server user (aka, www-data on some systems).

   "For security reasons, when reading text files located on the server, the files must either reside in the database directory or be readable by all."
<http://dev.mysql.com/doc/refman/5.1/en/load-data.html>

This tiny script shows what happens:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>
<html><head><title>file upload example</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <h1>file upload example</h1>

<h2>$_FILES</h2>
<pre>
  <?php var_dump($_FILES); ?>
</pre>

<?php
   if (count($_FILES)>0) {
     $lscmd = 'ls -l '.$_FILES['userfile']['tmp_name'];
     echo '<h2>ls -l tmp_name</h2>'.PHP_EOL;
     echo '<pre>'.`$lscmd`.'</pre>'.PHP_EOL;
   }
?>


<form enctype="multipart/form-data" method="POST">
    <input type="hidden" name="MAX_FILE_SIZE" value="30000" />
    Send this file: <input name="userfile" type="file" />
    <input type="submit" value="Send File" /> </form>

</body>
</html>

When a file is submitted, this is the output:

file upload example
$_FILES

  array(1) {
  ["userfile"]=>
  array(5) {
    ["name"]=>
    string(15) "testfile.txt"
    ["type"]=>
    string(10) "text/plain"
    ["tmp_name"]=>
    string(14) "/tmp/phphxGoQm"
    ["error"]=>
    int(0)
    ["size"]=>
    int(4244)
  }
}

ls -l tmp_name

-rw------- 1 www-data www-data 4244 Jul 26 04:41 /tmp/phphxGoQm

Send this file: <form stuff shows up here>


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux