Hello List.
I am learning php and MySQL for my project work.
I am trying to upload files to local server.
First, a page is displayed on the browser to upload file
Relevant code:
form method=post action=index.php enctype=multipart/form-data
input type=file name=file
br
input type=submit
On 15/10/2011, at 4:01 PM, Partha Chowdhury wrote:
Then i set a check for the return value of move-uploaded_file.
if(isset ($move_uploaded_file)):
echo success;
else:
echo error in uploading;
endif;
But it does not print anything !
Assuming
On 15/10/11 08:35 AM, Simon J Welsh wrote:
Assuming you did $move_uploaded_file = move_uploaded_file($filename,
$destination);, then isset($move_uploaded_file) will always be true.
isset() just checks if the variable you past to it is set, not if it
has a non-false value. You could simply use
This is exactly what I mean.
Documentation should never leave room to interpretation.
At least, this is what I think.
Roberto Aloi
On 11 Dec 2009, at 22:36, Ashley Sheridan a...@ashleysheridan.co.uk
wrote:
On Fri, 2009-12-11 at 22:14 +, Roberto wrote:
Hi Joseph,
I'm perfectly fine
On Sat, 2009-12-12 at 11:49 +, Roberto Aloi wrote:
This is exactly what I mean.
Documentation should never leave room to interpretation.
At least, this is what I think.
Roberto Aloi
On 11 Dec 2009, at 22:36, Ashley Sheridan a...@ashleysheridan.co.uk
wrote:
On Fri, 2009-12-11
It's also a security flaw... php should be chrooted to the webroot! Or
it should be chrooted to the users home directory. Especially on windows
systems where security is not so strict.
My 2 cents,
Carl.
Roberto wrote:
Hi Joseph,
I'm perfectly fine with the concepts of absolute/relative path
On Sat, 2009-12-12 at 09:42 -0500, Carl Furst wrote:
It's also a security flaw... php should be chrooted to the webroot! Or
it should be chrooted to the users home directory. Especially on windows
systems where security is not so strict.
My 2 cents,
Carl.
Roberto wrote:
Hi Joseph,
Depends on the configuration. If I have a bunch of web sites and they
are all using files created, written and executed by the apache user,
when the apache process sudo execs the php from a specific web root I
want it to stay in that root. I don't want it to be able to write files
to another
Am I just drunk or blind or the documentation is simply wrong?
From the official doc
(http://uk2.php.net/manual/en/function.move-uploaded-file.php):
?php
$uploads_dir = '/uploads';
foreach ($_FILES[pictures][error] as $key = $error) {
if ($error == UPLOAD_ERR_OK) {
$tmp_name =
You should be able to use either an absolute or relative path. In the
code below, the path specified is absolute (it starts with /). If you
want it to be relative to your current directory, change the line to:
$uploads_dir = 'uploads'; or $uploads_dir = '../uploads';
So basically, it all
HI,
Premise 1:
echo exec(pwd); - /home/prof3ta/projects/moodle/htdocs/feedback_tool
Premise 2:
I have an upload folder with 777 permissions under:
/home/prof3ta/projects/moodle/htdocs/upload
Premise 3:
The server root is obviously htdocs:
/home/prof3ta/projects/moodle/htdocs
This said, the
When used in PHP, an absolute path does not go off the web root. In
Premise 3 below, an absolute path of /upload will NOT bring up the
directory /home/prof3ta/projects/moodle/htdocs/upload but rather
simply /upload In Windows terms, an absolute path would be
C:\upload versus
Hi Joseph,
I'm perfectly fine with the concepts of absolute/relative path and
webroot, trust me.
For me it was just unclear from the documentation the fact that the
target path in the move_uploaded_file function was absolute with
respect to the file system and not to the webroot.
At the beginning
On Fri, 2009-12-11 at 22:14 +, Roberto wrote:
Hi Joseph,
I'm perfectly fine with the concepts of absolute/relative path and
webroot, trust me.
For me it was just unclear from the documentation the fact that the
target path in the move_uploaded_file function was absolute with
respect
Hi
I have a problem with uploading files that are bigger than the Master Value
allow me to, which is 32 MB. I've set the max_upload_filesize and
max_post_size in a .htaccess file and the phpinfo() reports the new local
value (128 MB) according to the .htaccess, but the script fails silently
On Mon, Aug 24, 2009 at 09:54:03PM +0200, Thomas Gabrielsen wrote:
Hi
I have a problem with uploading files that are bigger than the Master
Value allow me to, which is 32 MB. I've set the max_upload_filesize and
max_post_size in a .htaccess file and the phpinfo() reports the new local
On Mon, Aug 24, 2009 at 09:54:03PM +0200, Thomas Gabrielsen wrote:
Hi
I have a problem with uploading files that are bigger than the Master
Value allow me to, which is 32 MB. I've set the max_upload_filesize and
max_post_size in a .htaccess file and the phpinfo() reports the new local
Ryan Cavicchioni ryan...@confabulator.net wrote in message
news:20090824205810.gc32...@mail.confabulator.net...
On Mon, Aug 24, 2009 at 09:54:03PM +0200, Thomas Gabrielsen wrote:
Hi
I have a problem with uploading files that are bigger than the Master
Value allow me to, which is 32 MB. I've
I would also be shure that u run into the srcipt time out time. of course
there is one limit u can be a little bit under or a little bit above.
measure the time with microtime() and compare it with the script time out
settings and u will have the answer
ralph_def...@yahoo.de
Thomas Gabrielsen
Hi,
I'm having problem with function move_uploaded_file() under Linux
(Slackware 12.2). It simply want execute only that function in php
file. So maybe I should add something to http.config file or ? I
tried to execute that php file under Windows and it's working just
fine (I've copied
Hey
when i upload a file with the move_uploaded_file function the perm on
the uploaded file is 0600
the same work with copy the result ist 0644
with php4 the result was always the same and know with php5 it is
diffrent
i serached in the bug list and found this in the link below
and it is not a
Hi all,
I'm having a weird problem on my web hosting provider's server. I'm
using drupal with the image module and the image_pub module to upload a
series of pictures using Gallery Remote. This software uploads pictures
one after the other using a classic HTTP POST method.
The upload always
On Mon, August 27, 2007 12:55 pm, Hugues De Keyzer wrote:
I'm having a weird problem on my web hosting provider's server. I'm
using drupal with the image module and the image_pub module to upload
a
series of pictures using Gallery Remote. This software uploads
pictures
one after the other
On Wed, September 20, 2006 1:36 pm, Matthew H. North wrote:
Can't find this in the PHP docs, so: does anyone know whether
move_uploaded_file locks the target file during the process?
If move_uploaded_file does a rename within the same filesystem this
isn't an
issue (on unix, anyway, the O/S
Can't find this in the PHP docs, so: does anyone know whether
move_uploaded_file locks the target file during the process?
If move_uploaded_file does a rename within the same filesystem this isn't an
issue (on unix, anyway, the O/S just reassigns inodes rather than copying
data). But if it
Matthew H. North wrote:
Can't find this in the PHP docs, so: does anyone know whether
move_uploaded_file locks the target file during the process?
If move_uploaded_file does a rename within the same filesystem this isn't an
issue (on unix, anyway, the O/S just reassigns inodes rather than
Hi,
I have changed the directory to the same disk. Results are _much_ better!
So nothing to blame on PHP, only my lack of knowledge about *nix-like
system *blush*
Thank all for the advice and help!
Cheers,
Aleks
PS. defining of php_value in virtual host of apache did not work, so I
changed
Aleksandar Skodric wrote:
Hi,
I have changed the directory to the same disk. Results are _much_ better!
So nothing to blame on PHP, only my lack of knowledge about *nix-like
system *blush*
Thank all for the advice and help!
It's not *nix systems - it's all operating systems.
When you move
Hi,
Yes, /tmp is on another disk then the final directory. I shall move it
to the same disk (tmp_upload_dir) right now.
Question: can I define tmp_upload_dir to be otherwise just for one host
in apache conf, like:
php_ini upload_tmp_dir /some/dir
I am not sure that this works for all PHP
Aleksandar Skodric wrote:
Hi,
Yes, /tmp is on another disk then the final directory. I shall move it
to the same disk (tmp_upload_dir) right now.
Question: can I define tmp_upload_dir to be otherwise just for one host
in apache conf, like:
php_ini upload_tmp_dir /some/dir
snip
I'm
Hi,
My first mailing, if I'm in wrong group or such, let me know ;)
Here comes my question. I have implemented file uploads to my server. At the
end of upload, file is
beeing moved from /tmp to permanent directory. However, whenever this happens,
CPU goes berzerk and
waits for disk to finish
Are you sure its the move_uploaded_file() function that is causing the
delay? It could be the actual upload of the file itself. If it is the
function causing the delay than try the rename() function instead. Also, I
have used the copy() and unlink() functions and they work fast.
Aaron
On
My first mailing, if I'm in wrong group or such, let me know ;)
You've come to the right place :)
Here comes my question. I have implemented file uploads to my server. At the
end of upload, file is
beeing moved from /tmp to permanent directory. However, whenever this happens,
CPU goes
On Mon, Feb 27, 2006 at 06:39:13PM +0100, [EMAIL PROTECTED] wrote:
Hi,
My first mailing, if I'm in wrong group or such, let me know ;)
Here comes my question. I have implemented file uploads to my server. At the
end of upload, file is
beeing moved from /tmp to permanent directory.
On Tue, Feb 28, 2006 at 09:43:30AM +0800, stone.wang wrote:
unsubscribe
unsubscribe
unsubscribe
unsubscribe
unsubscribe
unsubscribe
unsubscribe
unsubscribe
unsubscribe
unsubscribe
unsubscribe
unsubscribe
unsubscribe
unsubscribe
dont send to me
Since you hijacked my thread, to
On Tue, Feb 28, 2006 at 11:08:30AM +0800, stone.wang wrote:
No usa to it http://php.net/unsub.php
Yes fondu no be http://php.net/unsub.php
i do more
If english isn't your first language try to explain that you are
not clear how to remove yourself from the list, otherwise try
emailing:
I'm seeing a very strange problem with move_uploaded_file(...). I'm
uploading jpegs and the transfer appears to go a little too quickly,
and when I look at the directory listing, the files are about twice the
size that they should be. When we view the file in the browser, the
images are either
hi, there!
I have a script that basically tries to upload a file to the server. But when the
move_uploaded_function is called, it returns these errors:
Warning: move_uploaded_file(../Main/ImgStiri/ceva.jpg): failed to open stream:
Permission denied in /home/gotech/public_html/Nou/functii.php on
Mike wrote:
hi, there!
I have a script that basically tries to upload a file to the server. But when the
move_uploaded_function is called, it returns these errors:
Warning: move_uploaded_file(../Main/ImgStiri/ceva.jpg): failed to open stream: Permission denied in
Thanks for the explaination!!
That was the problem. One of the directories in the path did not have
execute permissions.
/T
on 8/17/04 7:58, Jason Wong at [EMAIL PROTECTED] wrote:
Please do not top post.
On Tuesday 17 August 2004 19:31, [EMAIL PROTECTED] wrote:
How do you do that
How do you do that exactly - sorry for the stupid question - but the perms
for [absolute_path¹]/ is already rwxrw-rw-.
Let me know if you are referring to a different way to set permissions...
Thanks for your help!
/T
on 8/16/04 23:52, Jason Wong at [EMAIL PROTECTED] wrote:
On Tuesday 17
Please do not top post.
On Tuesday 17 August 2004 19:31, [EMAIL PROTECTED] wrote:
How do you do that exactly - sorry for the stupid question - but the perms
for [absolute_path¹]/ is already rwxrw-rw-.
Let me know if you are referring to a different way to set permissions...
1) What is the
Warning: move_uploaded_file([absolute_path¹]/file.csv): failed to open
stream: Permission denied in [absolute_path¹]/file.csv on line 83
Warning: move_uploaded_file(): Unable to move '/tmp/phpXT5j85' to
'[absolute_path¹]/file.csv' in [absolute_path¹]/file.csv on line 83
I get the above
On Tuesday 17 August 2004 09:38, [EMAIL PROTECTED] wrote:
Warning: move_uploaded_file([absolute_path¹]/file.csv): failed to open
stream: Permission denied in [absolute_path¹]/file.csv on line 83
Give php permissions to [absolute_path¹]/ ?
--
Jason Wong - Gremlins Associates -
Hi!
I'm using the function move_uploaded_file in order to upload images on a
server.
My problem: It's not possible to upload a *.bmp file. Maybe this is not
possible with PHP's HTTP POST method, but I can't find a documentation.
Does anybody knows, if it's possible to configure PHP, that it's
Guido Schwab wrote:
Hi!
I'm using the function move_uploaded_file in order to upload images on a
server.
My problem: It's not possible to upload a *.bmp file. Maybe this is not
possible with PHP's HTTP POST method, but I can't find a documentation.
Does anybody knows, if it's possible to
Curt, et al --
...and then Curt Zirzow said...
%
% Message-ID: [EMAIL PROTECTED]
Mister Underhill, I presume? :-) I only just noticed this :-)
%
% * Thus wrote David T-G ([EMAIL PROTECTED]):
%
% I have set my umask to 117 (and I change it when making a directory) and
% I use
Hi, all --
...and then David T-G said...
%
...
% I have set my umask to 117 (and I change it when making a directory) and
% I use move_uploaded_file to handle submitted files.
...
% Must I really run chmod() on every move_uploaded_file() I process? Isn't
% there a better way?
Wow, it's not
* Thus wrote David T-G ([EMAIL PROTECTED]):
Hi, all --
I have set my umask to 117 (and I change it when making a directory) and
I use move_uploaded_file to handle submitted files.
The temporary file is mode 600 when it lands in /var/tmp but somehow gets
changed to 666 during the move. It
Hi, all --
I have set my umask to 117 (and I change it when making a directory) and
I use move_uploaded_file to handle submitted files.
The temporary file is mode 600 when it lands in /var/tmp but somehow gets
changed to 666 during the move. It seems that move_uploaded_file changes
the file
Hello everybody!
I'm trying to upload a file using the move_uploaded_file function, everyting
works fine when the files have less than 1MB but when I upload one more than
this, IE returns the error The page cannot be displayed and in it's title
shows Cannot find server. I alreary edit php.ini
I'm trying to enable my site users to upload pictures (using the
move_uploaded_file function)
This works fine on my home development machine but 'not' on the deployment
server. This is a shared server with 'safe mode' enabled. (The php manual
seems to suggest that it should still work despite
There could be a lot of different reasons why. Check the manual again (esp.
the user's comments). I'm sure you'll find a lot of ideas.
http://www.php.net/manual/en/features.file-upload.php
Also, this has been discussed many times recently. I'm sure you'll find a
lot too in the archives. :)
I run a site where users can, among other things, adopt virtual pets. I
have several admisistrators on the site, and I am trying to create a thing
that adds a new pet species through the administrator control panel without
me having to ftp it. It takes four files: red happy, red sad, blue
I run a site where users can, among other things, adopt virtual pets. I
have several admisistrators on the site, and I am trying to create a thing
that adds a new pet species through the administrator control panel without
me having to ftp it. It takes four files: red happy, red sad, blue
Sorry for my past ignorance using this news site forum I can only out this
down to my lack of knowledge.
I have been work on me first script for some time now and have been making
good progress up until now. I have a script that adds a author to the
database, ID, Name, Email, Picture Name.
When
On Friday 25 January 2002 17:35, Will Hives wrote:
Sorry for my past ignorance using this news site forum I can only out this
down to my lack of knowledge.
I have been work on me first script for some time now and have been making
good progress up until now. I have a script that adds a
in article [EMAIL PROTECTED], Jason Wong at
[EMAIL PROTECTED] wrote on 25/1/02 3:14 pm:
On Friday 25 January 2002 17:35, Will Hives wrote:
Sorry for my past ignorance using this news site forum I can only out this
down to my lack of knowledge.
I have been work on me first script for some
On Saturday 26 January 2002 05:45, will hives wrote:
No I don't have a procedure to retrieve the new file name that's what I am
looking to do. I don't know how to write that new name into the database.
You really need to learn to read the fine manual - chapter on Handling file
uploads.
Hi,
I've been having a problem moving uploaded files recently.
I have a script in directory
/foo/bar
and it has no trouble moving a file into
/foo/rex
but it can't move a file into
/foo/zip
This is strange because I created all the folders and the scripts, so
presumably they would
, August 31, 2001 4:35 PM
Subject: [PHP] move_uploaded_file and related question
but why i should use move_uploaded_file and similar functions instead of a
simple copy command??
which is the security hole related to the use of copy??
At the php site is strongly encouraged the use
I tried the new move_uploaded_file() function. It seems to work fine
but doesn't assign any permissions to the moved file, not even for
reading.
Is there any way around this? Can I define the permissions myself?
kind regards,
bill hollett
--
PHP General Mailing List (http://www.php.net/)
62 matches
Mail list logo