Re: [PHP] uploading file encoding error

2010-05-27 Thread Ashley Sheridan
On Thu, 2010-05-27 at 18:03 +0300, Manolis Vlachakis wrote:

> i am using gentoo
> 
> and on the server side i cant see either the files with their greek
> names
> but i had no problem in the past handling them even though
> i couldn't see them...
> 
> 
> my servers log say that they uploaded the file but no
> error occurred...
> is there another way to upload a file with that script or i should try
> to find something else to solve my problem

[/SNIP]

> 
> 
> -- 
> Manolis Vlachakis
> 
> Nelly's Family Hotel 
> Visit:   www.nellys-hotel.gr
>   www.nellys.gr
> Skype : manolis.vlachakis
> 

Gentoo I believe uses the ext3 filesystem by default, which should be
perfectly capable of handling Greek characters.

What happens when you upload a normal small file now with non-Greek
characters and see what happens? Does that upload correctly?

Output the $_FILES array and look to see if the error code is anything
other than 0. If it is, that means there's a problem with the upload,
which probably won't show on the server log.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] uploading file encoding error

2010-05-27 Thread Ashley Sheridan
On Thu, 2010-05-27 at 17:49 +0300, Manolis Vlachakis wrote:

> hallo there everyone!
> i am uploading a file in a php applet i developed and i face a problem
> while i upload greek named files..
> have no problem with the english or so on files...
> is there a way to use iconv or something else so as to solve my problem ?
> my code looks like that...
> 
> 
> $uploaddir = $_SERVER['DOCUMENT_ROOT'] . '/
> //public_html/uploads/';
> $file = $uploaddir . basename($_FILES['uploadfile']['name']);
> if (move_uploaded_file($_FILES['uploadfile']['tmp_name'], $file)) {
>   echo "success";
> } else {
> echo "error";
> }
> 
> 
> 
> thanx
> 


I assume that the file upload works with other files?

Firstly, what is the filesystem that you're using, and the operating
system. Windows filesystems are very limiting on what characters you can
use.

If you have it working with another file, have you tried renaming that
to use characters which you think are causing the problems?

Lastly, what exactly is the error code returned from the $_FILES array?

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] uploading file

2005-04-13 Thread Greg Donald
On 4/13/05, Joseph Connolly <[EMAIL PROTECTED]> wrote:
> I though you could limit it in the php.ini file.

You can.

> OR, you can determine
> it's length through php and then discard it.

You can.

> I remember reading
> something about limiting file size and overidding that limit in the
> script. If i find it i will post it here.

You can, but any settings you put in place will not take effect until
PHP gets the file.  PHP has no clue what is going on on the client
side so until the file is uploaded to the server it can't act on the
file one way or the other.  PHP is a server-side scripting language
not a client-side scripting language.


-- 
Greg Donald
Zend Certified Engineer
http://destiney.com/

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



Re: [PHP] uploading file

2005-04-13 Thread Joseph Connolly
Thanks for the info. That makes sense.
John Nichel wrote:
Joseph Connolly wrote:
I though you could limit it in the php.ini file. OR, you can 
determine it's length through php and then discard it. I remember 
reading something about limiting file size and overidding that limit 
in the script. If i find it i will post it here.

You can limit it with PHP.  However, for php to determine the filesize 
and check it against the limit, the file has to be uploaded first, ie 
on the server.  The OP wants to check the filesize while it's still on 
the client machine, and PHP can't do that.

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


Re: [PHP] uploading file

2005-04-13 Thread John Nichel
Joseph Connolly wrote:
I though you could limit it in the php.ini file. OR, you can determine 
it's length through php and then discard it. I remember reading 
something about limiting file size and overidding that limit in the 
script. If i find it i will post it here.
You can limit it with PHP.  However, for php to determine the filesize 
and check it against the limit, the file has to be uploaded first, ie on 
the server.  The OP wants to check the filesize while it's still on the 
client machine, and PHP can't do that.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] uploading file

2005-04-13 Thread Joseph Connolly
I though you could limit it in the php.ini file. OR, you can determine 
it's length through php and then discard it. I remember reading 
something about limiting file size and overidding that limit in the 
script. If i find it i will post it here.

Richard Davey wrote:
Hello Marc,
Wednesday, April 13, 2005, 3:08:06 PM, you wrote:
ms> Hi, i want to create a form to upload a file on a server. My
ms> problem is that i want to check the filesize before sending it
ms> because if the filesize is superior than 2 MB it failed and i
ms> don't want to wait for a long time for uploading a file that will
ms> fail.
This isn't possible with PHP alone. You could do it by using some kind
of client-side uploader (Java applet, maybe a JavaScript post-back,
etc), but not PHP by itself.
Best regards,
Richard Davey
 

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


Re: [PHP] uploading file

2005-04-13 Thread Richard Davey
Hello Marc,

Wednesday, April 13, 2005, 3:08:06 PM, you wrote:

ms> Hi, i want to create a form to upload a file on a server. My
ms> problem is that i want to check the filesize before sending it
ms> because if the filesize is superior than 2 MB it failed and i
ms> don't want to wait for a long time for uploading a file that will
ms> fail.

This isn't possible with PHP alone. You could do it by using some kind
of client-side uploader (Java applet, maybe a JavaScript post-back,
etc), but not PHP by itself.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I do not fear computers. I fear the lack of them." - Isaac Asimov

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



RE: [PHP] Uploading file problem

2003-03-06 Thread Rich Gray
> Thanks!!  I'll give that a try!
> 
> On Thu, 6 Mar 2003, 1LT John W. Holmes wrote:
> 
> > > Well, I have a statement that says:
> > > 
> > > if ([EMAIL PROTECTED]($photo, $long_path . "speakers/" . $photo_name)) {
> > > echo an error
> > > }else{
> > > proceed with renaming the file
> > > }
> > > 
> > > The error that is echoed after the copy is the one that pops 
> up.  So, it
> > > could be some other problem, but I'm not sure what to look for.
> > 
> > Take out the @ sign so you can see what the PHP error message is. 
> > 
> > ---John Holmes...

Try using move_uploaded_file() as well...
Rich 

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



Re: [PHP] Uploading file problem

2003-03-06 Thread Amanda McComb
Thanks!!  I'll give that a try!

On Thu, 6 Mar 2003, 1LT John W. Holmes wrote:

> > Well, I have a statement that says:
> > 
> > if ([EMAIL PROTECTED]($photo, $long_path . "speakers/" . $photo_name)) {
> > echo an error
> > }else{
> > proceed with renaming the file
> > }
> > 
> > The error that is echoed after the copy is the one that pops up.  So, it
> > could be some other problem, but I'm not sure what to look for.
> 
> Take out the @ sign so you can see what the PHP error message is. 
> 
> ---John Holmes...
> 
> 
> 


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



Re: [PHP] Uploading file problem

2003-03-06 Thread Jason Wong
On Friday 07 March 2003 03:28, Amanda McComb wrote:
> Well, I have a statement that says:
>
> if ([EMAIL PROTECTED]($photo, $long_path . "speakers/" . $photo_name)) {
>   echo an error
> }else{
>   proceed with renaming the file
> }

The copy() function allows you to specify a destination filename so there is 
no need for the extra step of renaming the file.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
People usually get what's coming to them ... unless it's been mailed.
*/


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



Re: [PHP] Uploading file problem

2003-03-06 Thread 1LT John W. Holmes
> Well, I have a statement that says:
> 
> if ([EMAIL PROTECTED]($photo, $long_path . "speakers/" . $photo_name)) {
> echo an error
> }else{
> proceed with renaming the file
> }
> 
> The error that is echoed after the copy is the one that pops up.  So, it
> could be some other problem, but I'm not sure what to look for.

Take out the @ sign so you can see what the PHP error message is. 

---John Holmes...

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



Re: [PHP] Uploading file problem

2003-03-06 Thread Amanda McComb
Well, I have a statement that says:

if ([EMAIL PROTECTED]($photo, $long_path . "speakers/" . $photo_name)) {
echo an error
}else{
proceed with renaming the file
}

The error that is echoed after the copy is the one that pops up.  So, it
could be some other problem, but I'm not sure what to look for.

On Thu, 6 Mar 2003, Mark Heintz PHP Mailing Lists wrote:

> 
> What do you mean by "fails at the copy"?  Have you verified that the
> filename and path you're copying to is valid?  Otherwise, if the filename
> that is failing is consistently the same, and if it's attempting to
> overwrite an existing file, it could be a permissions problem.  Just a
> couple of guesses...
> 
> mh.
> 
> On Thu, 6 Mar 2003, Amanda McComb wrote:
> 
> > I'm very new to PHP, so I hope no one is offended by reading my very basic
> > questions.
> >
> > I have created a web form that saves some data to a database and uploads
> > three files, copies them to a new directory, and renames them.  From my
> > work machine and home machine, it works great for me - there are never any
> > errors.  When my boss tries it, two of the files work fine, but the other
> > fails at the copy.  I have watched him do it, and it's not user error.
> > What could the problem be?  I'm stumped!
> >
> > I can include code or links if needed.
> >
> > Thanks,
> > Amanda
> 
> 
> 


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



Re: [PHP] Uploading file problem

2003-03-06 Thread Mark Heintz PHP Mailing Lists

What do you mean by "fails at the copy"?  Have you verified that the
filename and path you're copying to is valid?  Otherwise, if the filename
that is failing is consistently the same, and if it's attempting to
overwrite an existing file, it could be a permissions problem.  Just a
couple of guesses...

mh.

On Thu, 6 Mar 2003, Amanda McComb wrote:

> I'm very new to PHP, so I hope no one is offended by reading my very basic
> questions.
>
> I have created a web form that saves some data to a database and uploads
> three files, copies them to a new directory, and renames them.  From my
> work machine and home machine, it works great for me - there are never any
> errors.  When my boss tries it, two of the files work fine, but the other
> fails at the copy.  I have watched him do it, and it's not user error.
> What could the problem be?  I'm stumped!
>
> I can include code or links if needed.
>
> Thanks,
> Amanda


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



RE: [PHP] Uploading file problem

2003-03-06 Thread Amanda McComb
The files go to different directories, but I checked the permissions on
all of the directories, and they are all '777'.  I am able to upload
files, so I think the directory is ok.

The server is unix.  

I am going to ask my boss to send me the files he is trying to upload to
see if the files are the problem.  If they are, what sort of problems
would I look for?

On Thu, 6 Mar 2003, Rich Gray wrote:

> > I'm very new to PHP, so I hope no one is offended by reading my very basic
> > questions.
> >
> > I have created a web form that saves some data to a database and uploads
> > three files, copies them to a new directory, and renames them.  From my
> > work machine and home machine, it works great for me - there are never any
> > errors.  When my boss tries it, two of the files work fine, but the other
> > fails at the copy.  I have watched him do it, and it's not user error.
> > What could the problem be?  I'm stumped!
> >
> > I can include code or links if needed.
> >
> > Thanks,
> > Amanda
> 
> From what you say above I'd check the permissions on the 3rd target
> directory to check if it allows writes by the web server process. Are all 3
> files going into the same directory? Is the server *nix or Windows?
> 
> Rich
> 
> 
> -- 
> 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] Uploading file problem

2003-03-06 Thread Rich Gray
> I'm very new to PHP, so I hope no one is offended by reading my very basic
> questions.
>
> I have created a web form that saves some data to a database and uploads
> three files, copies them to a new directory, and renames them.  From my
> work machine and home machine, it works great for me - there are never any
> errors.  When my boss tries it, two of the files work fine, but the other
> fails at the copy.  I have watched him do it, and it's not user error.
> What could the problem be?  I'm stumped!
>
> I can include code or links if needed.
>
> Thanks,
> Amanda

>From what you say above I'd check the permissions on the 3rd target
directory to check if it allows writes by the web server process. Are all 3
files going into the same directory? Is the server *nix or Windows?

Rich


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



Re: [PHP] Uploading file

2002-09-04 Thread Justin French

There is a perfecting good working example of file uploads on php.net...
never quite sure why people re-invent the wheel all the time.

In the example (at http://www.php.net/manual/en/features.file-upload.php),
they make a call to move_uploaded_file()... until you do that, and move it
to where you want, it IS in the temporary location, set my php.ini, although
it may get deleted at the end of the script if it hasn't been moved
elsewhere...  you need to move the uploaded file to an area within your disc
hierarchy.

Justin


on 04/09/02 8:16 PM, skitum ([EMAIL PROTECTED]) wrote:

> i have the same problem. Where is the kind soul who can help us?
> 
> Peace & Love
> skitum
> 
> - Original Message -
> From: "Clemson Chan" <[EMAIL PROTECTED]>
> To: "Juan Pablo Aqueveque" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Wednesday, September 04, 2002 12:25 AM
> Subject: RE: [PHP] Uploading file
> 
> 
>> Thanks Juan, and other listers,
>> 
>> I have this example,
>> 
>> 
>> 
>> Figure 7-3
>> 
>> 
>> > //check for file upload
>> if(isset($UploadedFile))
>> {
>> unlink($UploadedFile);
>> print("Local File: $UploadedFile \n");
>> print("Name: $UploadedFile_name \n");
>> print("Size: $UploadedFile_size \n");
>> print("Type: $UploadedFile_type \n");
>> print("\n");
>> }
>> ?>
>> > ACTION="7-3.php" METHOD="post">
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> and the result is this after I uploaded a file
>> 
>> Local File: /tmp/phpnYLV2J
>> Name: 323lake.jpg
>> Size: 48254
>> Type: image/pjpeg
>> 
>> But I couldn't find the uploaded file, nor the /tmp/phpnYLV2J path.
>> Do I normally do a copy after the upload?
>> Can I just change the tmp path and filename when I upload?
>> Thanks.
>> 
>> --Clemson
>> 
>> 
>> 
>> -Original Message-
>> From: Juan Pablo Aqueveque [mailto:[EMAIL PROTECTED]]
>> Sent: Tuesday, September 03, 2002 7:58 AM
>> To: Clemson Chan; [EMAIL PROTECTED]
>> Subject: Re: [PHP] Uploading file
>> 
>> 
>> Hi friend,
>> 
>> http://www.php.net/manual/en/features.file-upload.php
>> And take a look to the User Contributed Notes
>> 
>> --jp
>> 
>> At 13:03 03-09-2002 -0700, Clemson Chan wrote:
>>> Hi, I am new to this group.
>>> I am trying to figure out how to let people to upload image files to my
>>> website.
>>> My ISP is using PHP 3 (I believe).
>>> If someone can give me simple example, that will be great.
>>> Thanks.
>>> 
>>> --Clemson
>>> 
>>> How can I tell what version of PHP is running on the system (linux)?
>>> 
>>> 
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
>> 
>> Juan Pablo Aqueveque <[EMAIL PROTECTED]>
>> Ingeniero de Sistemas
>> Departamento de Redes y Comunicaciones http://www.drc.uct.cl
>> Universidad Católica de Temuco.
>> Tel:(5645) 205 630 Fax:(5645) 205 628
>> 
>> 
>> --
>> 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


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




Re: [PHP] Uploading file

2002-09-04 Thread skitum

i have the same problem. Where is the kind soul who can help us?

Peace & Love
skitum

- Original Message -
From: "Clemson Chan" <[EMAIL PROTECTED]>
To: "Juan Pablo Aqueveque" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, September 04, 2002 12:25 AM
Subject: RE: [PHP] Uploading file


> Thanks Juan, and other listers,
>
> I have this example,
>
> 
> 
> Figure 7-3
> 
> 
>  //check for file upload
> if(isset($UploadedFile))
> {
> unlink($UploadedFile);
> print("Local File: $UploadedFile \n");
> print("Name: $UploadedFile_name \n");
> print("Size: $UploadedFile_size \n");
> print("Type: $UploadedFile_type \n");
> print("\n");
> }
> ?>
>  ACTION="7-3.php" METHOD="post">
> 
> 
> 
> 
>
> 
> 
>
> and the result is this after I uploaded a file
>
> Local File: /tmp/phpnYLV2J
> Name: 323lake.jpg
> Size: 48254
> Type: image/pjpeg
>
> But I couldn't find the uploaded file, nor the /tmp/phpnYLV2J path.
> Do I normally do a copy after the upload?
> Can I just change the tmp path and filename when I upload?
> Thanks.
>
> --Clemson
>
>
>
> -Original Message-
> From: Juan Pablo Aqueveque [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 03, 2002 7:58 AM
> To: Clemson Chan; [EMAIL PROTECTED]
> Subject: Re: [PHP] Uploading file
>
>
> Hi friend,
>
> http://www.php.net/manual/en/features.file-upload.php
> And take a look to the User Contributed Notes
>
> --jp
>
> At 13:03 03-09-2002 -0700, Clemson Chan wrote:
> >Hi, I am new to this group.
> >I am trying to figure out how to let people to upload image files to my
> >website.
> >My ISP is using PHP 3 (I believe).
> >If someone can give me simple example, that will be great.
> >Thanks.
> >
> >--Clemson
> >
> >How can I tell what version of PHP is running on the system (linux)?
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
> 
> Juan Pablo Aqueveque <[EMAIL PROTECTED]>
> Ingeniero de Sistemas
> Departamento de Redes y Comunicaciones http://www.drc.uct.cl
> Universidad Católica de Temuco.
> Tel:(5645) 205 630 Fax:(5645) 205 628
>
>
> --
> 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

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




RE: [PHP] Uploading file

2002-09-03 Thread Clemson Chan

relative paths work too.
Thank you so much.

--Clemson

-Original Message-
From: Rodrigo Dominguez [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 03, 2002 3:55 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Uploading file


You are doing wrong... you are checking for the temp file and after that you
are deleting the temp file, you should copy the files first

This is your code

if(isset($UploadedFile))
{
unlink($UploadedFile); // Here you are deleting the temp file
print("Local File: $UploadedFile \n");
print("Name: $UploadedFile_name \n");
print("Size: $UploadedFile_size \n");
print("Type: $UploadedFile_type \n");
print("\n");
}

You should write something like this


if(isset($UploadedFile))
{
copy($UploadedFile, "/uploaded_files/" . $UploadedFile_name);  // Here
we first copy the temp file to a secure path, you should change the
/uploaded_files/

// path
print("Local File: $UploadedFile \n");
print("Name: $UploadedFile_name \n");
print("Size: $UploadedFile_size \n");
print("Type: $UploadedFile_type \n");
print("\n");

unlink($UploadedFile); // Now we can delete the temp file
}

"Clemson Chan" <[EMAIL PROTECTED]> escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Thanks Juan, and other listers,
>
> I have this example,
>
> 
> 
> Figure 7-3
> 
> 
>  //check for file upload
> if(isset($UploadedFile))
> {
> unlink($UploadedFile);
> print("Local File: $UploadedFile \n");
> print("Name: $UploadedFile_name \n");
> print("Size: $UploadedFile_size \n");
> print("Type: $UploadedFile_type \n");
> print("\n");
> }
> ?>
>  ACTION="7-3.php" METHOD="post">
> 
> 
> 
> 
>
> 
> 
>
> and the result is this after I uploaded a file
>
> Local File: /tmp/phpnYLV2J
> Name: 323lake.jpg
> Size: 48254
> Type: image/pjpeg
>
> But I couldn't find the uploaded file, nor the /tmp/phpnYLV2J path.
> Do I normally do a copy after the upload?
> Can I just change the tmp path and filename when I upload?
> Thanks.
>
> --Clemson
>
>
>
> -Original Message-
> From: Juan Pablo Aqueveque [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 03, 2002 7:58 AM
> To: Clemson Chan; [EMAIL PROTECTED]
> Subject: Re: [PHP] Uploading file
>
>
> Hi friend,
>
> http://www.php.net/manual/en/features.file-upload.php
> And take a look to the User Contributed Notes
>
> --jp
>
> At 13:03 03-09-2002 -0700, Clemson Chan wrote:
> >Hi, I am new to this group.
> >I am trying to figure out how to let people to upload image files to my
> >website.
> >My ISP is using PHP 3 (I believe).
> >If someone can give me simple example, that will be great.
> >Thanks.
> >
> >--Clemson
> >
> >How can I tell what version of PHP is running on the system (linux)?
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
> 
> Juan Pablo Aqueveque <[EMAIL PROTECTED]>
> Ingeniero de Sistemas
> Departamento de Redes y Comunicaciones http://www.drc.uct.cl
> Universidad Católica de Temuco.
> Tel:(5645) 205 630 Fax:(5645) 205 628
>
>
> --
> 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


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




RE: [PHP] Uploading file

2002-09-03 Thread Clemson Chan

Thank you so much.
I got the uploaded files now with full path
("/home/user/www/uploaded_files/") as the new path.
can I use relative path such as "../uploaded_files/" ?
Thanks

--Clemson


-Original Message-
From: Rodrigo Dominguez [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 03, 2002 3:55 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Uploading file


You are doing wrong... you are checking for the temp file and after that you
are deleting the temp file, you should copy the files first

This is your code

if(isset($UploadedFile))
{
unlink($UploadedFile); // Here you are deleting the temp file
print("Local File: $UploadedFile \n");
print("Name: $UploadedFile_name \n");
print("Size: $UploadedFile_size \n");
print("Type: $UploadedFile_type \n");
print("\n");
}

You should write something like this


if(isset($UploadedFile))
{
copy($UploadedFile, "/uploaded_files/" . $UploadedFile_name);  // Here
we first copy the temp file to a secure path, you should change the
/uploaded_files/

// path
print("Local File: $UploadedFile \n");
print("Name: $UploadedFile_name \n");
print("Size: $UploadedFile_size \n");
print("Type: $UploadedFile_type \n");
print("\n");

unlink($UploadedFile); // Now we can delete the temp file
}

"Clemson Chan" <[EMAIL PROTECTED]> escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Thanks Juan, and other listers,
>
> I have this example,
>
> 
> 
> Figure 7-3
> 
> 
>  //check for file upload
> if(isset($UploadedFile))
> {
> unlink($UploadedFile);
> print("Local File: $UploadedFile \n");
> print("Name: $UploadedFile_name \n");
> print("Size: $UploadedFile_size \n");
> print("Type: $UploadedFile_type \n");
> print("\n");
> }
> ?>
>  ACTION="7-3.php" METHOD="post">
> 
> 
> 
> 
>
> 
> 
>
> and the result is this after I uploaded a file
>
> Local File: /tmp/phpnYLV2J
> Name: 323lake.jpg
> Size: 48254
> Type: image/pjpeg
>
> But I couldn't find the uploaded file, nor the /tmp/phpnYLV2J path.
> Do I normally do a copy after the upload?
> Can I just change the tmp path and filename when I upload?
> Thanks.
>
> --Clemson
>
>
>
> -Original Message-
> From: Juan Pablo Aqueveque [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 03, 2002 7:58 AM
> To: Clemson Chan; [EMAIL PROTECTED]
> Subject: Re: [PHP] Uploading file
>
>
> Hi friend,
>
> http://www.php.net/manual/en/features.file-upload.php
> And take a look to the User Contributed Notes
>
> --jp
>
> At 13:03 03-09-2002 -0700, Clemson Chan wrote:
> >Hi, I am new to this group.
> >I am trying to figure out how to let people to upload image files to my
> >website.
> >My ISP is using PHP 3 (I believe).
> >If someone can give me simple example, that will be great.
> >Thanks.
> >
> >--Clemson
> >
> >How can I tell what version of PHP is running on the system (linux)?
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
> 
> Juan Pablo Aqueveque <[EMAIL PROTECTED]>
> Ingeniero de Sistemas
> Departamento de Redes y Comunicaciones http://www.drc.uct.cl
> Universidad Católica de Temuco.
> Tel:(5645) 205 630 Fax:(5645) 205 628
>
>
> --
> 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


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




Re: [PHP] Uploading file

2002-09-03 Thread Rodrigo Dominguez

You are doing wrong... you are checking for the temp file and after that you
are deleting the temp file, you should copy the files first

This is your code

if(isset($UploadedFile))
{
unlink($UploadedFile); // Here you are deleting the temp file
print("Local File: $UploadedFile \n");
print("Name: $UploadedFile_name \n");
print("Size: $UploadedFile_size \n");
print("Type: $UploadedFile_type \n");
print("\n");
}

You should write something like this


if(isset($UploadedFile))
{
copy($UploadedFile, "/uploaded_files/" . $UploadedFile_name);  // Here
we first copy the temp file to a secure path, you should change the
/uploaded_files/

// path
print("Local File: $UploadedFile \n");
print("Name: $UploadedFile_name \n");
print("Size: $UploadedFile_size \n");
print("Type: $UploadedFile_type \n");
print("\n");

unlink($UploadedFile); // Now we can delete the temp file
}

"Clemson Chan" <[EMAIL PROTECTED]> escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Thanks Juan, and other listers,
>
> I have this example,
>
> 
> 
> Figure 7-3
> 
> 
>  //check for file upload
> if(isset($UploadedFile))
> {
> unlink($UploadedFile);
> print("Local File: $UploadedFile \n");
> print("Name: $UploadedFile_name \n");
> print("Size: $UploadedFile_size \n");
> print("Type: $UploadedFile_type \n");
> print("\n");
> }
> ?>
>  ACTION="7-3.php" METHOD="post">
> 
> 
> 
> 
>
> 
> 
>
> and the result is this after I uploaded a file
>
> Local File: /tmp/phpnYLV2J
> Name: 323lake.jpg
> Size: 48254
> Type: image/pjpeg
>
> But I couldn't find the uploaded file, nor the /tmp/phpnYLV2J path.
> Do I normally do a copy after the upload?
> Can I just change the tmp path and filename when I upload?
> Thanks.
>
> --Clemson
>
>
>
> -Original Message-
> From: Juan Pablo Aqueveque [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 03, 2002 7:58 AM
> To: Clemson Chan; [EMAIL PROTECTED]
> Subject: Re: [PHP] Uploading file
>
>
> Hi friend,
>
> http://www.php.net/manual/en/features.file-upload.php
> And take a look to the User Contributed Notes
>
> --jp
>
> At 13:03 03-09-2002 -0700, Clemson Chan wrote:
> >Hi, I am new to this group.
> >I am trying to figure out how to let people to upload image files to my
> >website.
> >My ISP is using PHP 3 (I believe).
> >If someone can give me simple example, that will be great.
> >Thanks.
> >
> >--Clemson
> >
> >How can I tell what version of PHP is running on the system (linux)?
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
> 
> Juan Pablo Aqueveque <[EMAIL PROTECTED]>
> Ingeniero de Sistemas
> Departamento de Redes y Comunicaciones http://www.drc.uct.cl
> Universidad Católica de Temuco.
> Tel:(5645) 205 630 Fax:(5645) 205 628
>
>
> --
> 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] Uploading file

2002-09-03 Thread Clemson Chan

Thanks Juan, and other listers,

I have this example,



Figure 7-3


\n");
print("Name: $UploadedFile_name \n");
print("Size: $UploadedFile_size \n");
print("Type: $UploadedFile_type \n");
print("\n");
}
?>
 
 
 
 





and the result is this after I uploaded a file

Local File: /tmp/phpnYLV2J 
Name: 323lake.jpg 
Size: 48254 
Type: image/pjpeg 

But I couldn't find the uploaded file, nor the /tmp/phpnYLV2J path.
Do I normally do a copy after the upload? 
Can I just change the tmp path and filename when I upload? 
Thanks.

--Clemson



-Original Message-
From: Juan Pablo Aqueveque [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 03, 2002 7:58 AM
To: Clemson Chan; [EMAIL PROTECTED]
Subject: Re: [PHP] Uploading file


Hi friend,

http://www.php.net/manual/en/features.file-upload.php
And take a look to the User Contributed Notes

--jp

At 13:03 03-09-2002 -0700, Clemson Chan wrote:
>Hi, I am new to this group.
>I am trying to figure out how to let people to upload image files to my
>website.
>My ISP is using PHP 3 (I believe).
>If someone can give me simple example, that will be great.
>Thanks.
>
>--Clemson
>
>How can I tell what version of PHP is running on the system (linux)?
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


Juan Pablo Aqueveque <[EMAIL PROTECTED]>
Ingeniero de Sistemas
Departamento de Redes y Comunicaciones http://www.drc.uct.cl
Universidad Católica de Temuco.
Tel:(5645) 205 630 Fax:(5645) 205 628


-- 
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] Uploading file

2002-09-03 Thread victor



tell you most things about php and some things about web server and dbs

- Victor > www.argilent.com

-Original Message-
From: Clemson Chan [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, September 03, 2002 4:04 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Uploading file

Hi, I am new to this group.
I am trying to figure out how to let people to upload image files to my
website.
My ISP is using PHP 3 (I believe).
If someone can give me simple example, that will be great.
Thanks.

--Clemson

How can I tell what version of PHP is running on the system (linux)?


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

__ 
Post your free ad now! http://personals.yahoo.ca

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




Re: [PHP] Uploading file

2002-09-03 Thread Juan Pablo Aqueveque

Hi friend,

http://www.php.net/manual/en/features.file-upload.php
And take a look to the User Contributed Notes

--jp

At 13:03 03-09-2002 -0700, Clemson Chan wrote:
>Hi, I am new to this group.
>I am trying to figure out how to let people to upload image files to my
>website.
>My ISP is using PHP 3 (I believe).
>If someone can give me simple example, that will be great.
>Thanks.
>
>--Clemson
>
>How can I tell what version of PHP is running on the system (linux)?
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


Juan Pablo Aqueveque <[EMAIL PROTECTED]>
Ingeniero de Sistemas
Departamento de Redes y Comunicaciones http://www.drc.uct.cl
Universidad Católica de Temuco.
Tel:(5645) 205 630 Fax:(5645) 205 628


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




Re: [PHP] uploading file

2001-02-08 Thread Shane McBride

Yea, I guess I should have stripped out some of the special code before I
posted. The ^ replaces \ when the user inserts the windows path, than I
replace the ^ with \\ so the path works correctly.

I did get this to work. I was sure fighting it though...

- Shane
DISCLAIMER: I am by no means an expert on this, or any other, topic...

- Original Message -
From: "Richard Lynch" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 08, 2001 3:40 AM
Subject: Re: [PHP] uploading file


> // Creates the image file with a timestamp
> $timestamp = time();
> $image= $timestamp.$picture_name;
>
> if ($PLATFORM == "windows") {
> $new_path = str_replace('^', '\\', $WINDOWS_PATH);
>
> What's with the "^"?...
> And, since \ is special in PHP, you are changing ^ to \?  Why?
>
> echo $picture;
> if (is_uploaded_file($picture)) {
> copy($picture, $new_path);
> file://move_uploaded_file($picture, $new_path);
> } else {
> echo "Possible file upload attack: filename '$picture'.";
> }
>
> #add this:
> echo "is_uploaded_file() failed.";
>
> }
>
>
>
> --
> Visit the Zend Store at http://www.zend.com/store/
> Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
> Volunteer a little time: http://chatmusic.com/volunteer.htm
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] uploading file

2001-02-08 Thread Phil Driscoll

>Everyone say : "Good morning mr. Lynch" !
Hear Hear! I was all overcome with a wave of nostalgia :)
Cheers
-- 
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] uploading file

2001-02-08 Thread Maxim Maletsky

Everyone say : "Good morning mr. Lynch" !

Man, I enjoy that,


Cheers,
Maxim Maletsky



-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 08, 2001 5:41 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] uploading file


// Creates the image file with a timestamp
$timestamp = time();
$image= $timestamp.$picture_name;

if ($PLATFORM == "windows") {
$new_path = str_replace('^', '\\', $WINDOWS_PATH);   

What's with the "^"?...
And, since \ is special in PHP, you are changing ^ to \?  Why?

echo $picture;
if (is_uploaded_file($picture)) {
copy($picture, $new_path);
file://move_uploaded_file($picture, $new_path);
} else {
echo "Possible file upload attack: filename '$picture'.";
}

#add this:
echo "is_uploaded_file() failed.";

}



-- 
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] uploading file

2001-02-08 Thread Richard Lynch

// Creates the image file with a timestamp
$timestamp = time();
$image= $timestamp.$picture_name;

if ($PLATFORM == "windows") {
$new_path = str_replace('^', '\\', $WINDOWS_PATH);   

What's with the "^"?...
And, since \ is special in PHP, you are changing ^ to \?  Why?

echo $picture;
if (is_uploaded_file($picture)) {
copy($picture, $new_path);
file://move_uploaded_file($picture, $new_path);
} else {
echo "Possible file upload attack: filename '$picture'.";
}

#add this:
echo "is_uploaded_file() failed.";

}



-- 
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]