RE: [PHP] Not a regular file?
| From: | kyle.smith | Date: | Thu, 04 Jun 2009 14:35:15 +0000 |
| Subject: | RE: [PHP] Not a regular file? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-293606@lists.php.net to get a copy of this message | ||
Likewise, do some debug output.
echo "I'm going to upload $FilePath to $remote_path.";
Make sure it looks sane, maybe your variables aren't what you think they
are... You can also use is_file() on http:// locations, AFAIK.
-----Original Message-----
From: Miller, Terion [mailto:tmiller@springfi.gannett.com]
Sent: Thursday, June 04, 2009 10:32 AM
To: haliphax; PHP-General List
Subject: Re: [PHP] Not a regular file?
Here is my code for the ftp_put
$conn_id = ftp_connect($ftp_server); $login_result =
ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); $FilePath =
"http://localhost:8888/HarrisAutomate/output/WebImagesHiRes/$ImageName";
$remote_path = "/httpdocs/Announcements/photos/obitsTest/";
set_time_limit(120); ftp_pasv($conn_id, true); // upload a
file if (ftp_put($conn_id, $remote_path, $FilePath, FTP_BINARY))
{ echo "successfully uploaded $ImageName\n"; }
else { echo "There was a problem while uploading
$ImageName\n"; } // close the connection ftp_close($conn_id);
Since it is passing a full path I don't know how it can be only going to
the directory?
On 6/4/09 9:22 AM, "haliphax" <haliphax@gmail.com> wrote:
On Thu, Jun 4, 2009 at 9:07 AM, Miller, Terion
<tmiller@springfi.gannett.com> wrote:
> I've never encountered this error:
>
> Warning: ftp_put() [function.ftp-put]:
> /httpdocs/Announcements/photos/obitsTest/: Not a regular file in
> /Applications/MAMP/htdocs/HarrisAutomate/ObitsTester.php on line 149
> There was a problem while uploading 659428.jpg 658626
>
> Can't find much info on how to correct it, anyone seen this?
http://www.lmgtfy.com/?q=php+%22not+a+regular+file%22
Apparently, it's not actually a file in the first place. Just a
guess--but most all incidents of ftp_put throwing this error that I've
found in web searches point to someone using it on a directory/etc.
--
// Todd
--
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