Re: [PHP] php upload does not work proper, [tmp_name] and other are missing in $_FILES

2012-03-21 Thread Meike Stone
2012/3/20 Meike Stone meike.st...@googlemail.com:

 First of all, check your apache log files for any hints. There's
 probably a warning/error in there that explains why.

 I switched to LogLevel debug but in error_log is nothing found,
 the access_log showes only:
 192.168.1.89 - - [20/Mar/2012:16:43:53 +0100] POST /i3.php HTTP/1.1
 200 539 http://172.16.1.170/i3.php; Mozilla/5.0 (Windows NT 5.1;
 WOW64; rv:11.0) Gecko/20100101 Firefox/11.0

 If not, check your php.ini settings, there are a few settings that can
 affect uploads (see [1]).

 [1] http://nl3.php.net/manual/en/ini.core.php#ini.sect.file-uploads

 Yes, I know this settings and checked this and disabled suhosin too.
 Nothing helped.
 I did this before stracing ...


 Thanks Meike

I investigated a little bit more and found, that if I only swapped the
Apache php module (moved away the original
/usr/lib64/apache2/mod_php5.so and placed one from 5.2.14)
from php 5.2.14, all works, same configuration! So it should not a
problem of the configuration.

But what is the reason, that the module not work properly?
Which next step can I do?

Thanks Meike

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



Re: [PHP] php upload does not work proper, [tmp_name] and other are missing in $_FILES

2012-03-21 Thread Meike Stone

 But what is the reason, that the module not work properly?
 Which next step can I do?

I figured out, that the new mod_php5.so is not linked against
libmm.so.14. Can this be the problem?

Thanks Meike

# ldd mod_php5.so.5.3.8
linux-vdso.so.1 =  (0x7fffe051c000)
libcrypt.so.1 = /lib64/libcrypt.so.1 (0x7f3d30f82000)
libresolv.so.2 = /lib64/libresolv.so.2 (0x7f3d30d6b000)
libpcre.so.0 = /usr/lib64/libpcre.so.0 (0x7f3d30b3a000)
librt.so.1 = /lib64/librt.so.1 (0x7f3d30931000)
libm.so.6 = /lib64/libm.so.6 (0x7f3d306b8000)
libdl.so.2 = /lib64/libdl.so.2 (0x7f3d304b3000)
libnsl.so.1 = /lib64/libnsl.so.1 (0x7f3d3029b000)
libz.so.1 = /lib64/libz.so.1 (0x7f3d30085000)
libxml2.so.2 = /usr/lib64/libxml2.so.2 (0x7f3d2fd28000)
libc.so.6 = /lib64/libc.so.6 (0x7f3d2f9b4000)
libpthread.so.0 = /lib64/libpthread.so.0 (0x7f3d2f797000)
/lib64/ld-linux-x86-64.so.2 (0x7f3d31c0f000)

# ldd mod_php5.so.5.2.14
linux-vdso.so.1 =  (0x7fffcdfff000)
libmm.so.14 = /usr/lib64/libmm.so.14 (0x7f0307223000)
libcrypt.so.1 = /lib64/libcrypt.so.1 (0x7f0307428000)  
libresolv.so.2 = /lib64/libresolv.so.2 (0x7f0306bd2000)
libpcre.so.0 = /usr/lib64/libpcre.so.0 (0x7f0306ff2000)
librt.so.1 = /lib64/librt.so.1 (0x7f0306de9000)
libm.so.6 = /lib64/libm.so.6 (0x7f0306958000)
libdl.so.2 = /lib64/libdl.so.2 (0x7f0306754000)
libnsl.so.1 = /lib64/libnsl.so.1 (0x7f030653c000)
libz.so.1 = /lib64/libz.so.1 (0x7f0306325000)
libxml2.so.2 = /usr/lib64/libxml2.so.2 (0x7f0305fc9000)
libc.so.6 = /lib64/libc.so.6 (0x7f0305c55000)
libpthread.so.0 = /lib64/libpthread.so.0 (0x7f0305a37000)
/lib64/ld-linux-x86-64.so.2 (0x7f0307b51000)

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



Re: [PHP] php upload does not work proper, [tmp_name] and other are missing in $_FILES

2012-03-21 Thread Matijn Woudt
On Wed, Mar 21, 2012 at 3:32 PM, Meike Stone meike.st...@googlemail.com wrote:

 But what is the reason, that the module not work properly?
 Which next step can I do?

 I figured out, that the new mod_php5.so is not linked against
 libmm.so.14. Can this be the problem?

 Thanks Meike

 # ldd mod_php5.so.5.3.8
        linux-vdso.so.1 =  (0x7fffe051c000)
        libcrypt.so.1 = /lib64/libcrypt.so.1 (0x7f3d30f82000)
        libresolv.so.2 = /lib64/libresolv.so.2 (0x7f3d30d6b000)
        libpcre.so.0 = /usr/lib64/libpcre.so.0 (0x7f3d30b3a000)
        librt.so.1 = /lib64/librt.so.1 (0x7f3d30931000)
        libm.so.6 = /lib64/libm.so.6 (0x7f3d306b8000)
        libdl.so.2 = /lib64/libdl.so.2 (0x7f3d304b3000)
        libnsl.so.1 = /lib64/libnsl.so.1 (0x7f3d3029b000)
        libz.so.1 = /lib64/libz.so.1 (0x7f3d30085000)
        libxml2.so.2 = /usr/lib64/libxml2.so.2 (0x7f3d2fd28000)
        libc.so.6 = /lib64/libc.so.6 (0x7f3d2f9b4000)
        libpthread.so.0 = /lib64/libpthread.so.0 (0x7f3d2f797000)
        /lib64/ld-linux-x86-64.so.2 (0x7f3d31c0f000)

 # ldd mod_php5.so.5.2.14
        linux-vdso.so.1 =  (0x7fffcdfff000)
        libmm.so.14 = /usr/lib64/libmm.so.14 (0x7f0307223000)
        libcrypt.so.1 = /lib64/libcrypt.so.1 (0x7f0307428000)
        libresolv.so.2 = /lib64/libresolv.so.2 (0x7f0306bd2000)
        libpcre.so.0 = /usr/lib64/libpcre.so.0 (0x7f0306ff2000)
        librt.so.1 = /lib64/librt.so.1 (0x7f0306de9000)
        libm.so.6 = /lib64/libm.so.6 (0x7f0306958000)
        libdl.so.2 = /lib64/libdl.so.2 (0x7f0306754000)
        libnsl.so.1 = /lib64/libnsl.so.1 (0x7f030653c000)
        libz.so.1 = /lib64/libz.so.1 (0x7f0306325000)
        libxml2.so.2 = /usr/lib64/libxml2.so.2 (0x7f0305fc9000)
        libc.so.6 = /lib64/libc.so.6 (0x7f0305c55000)
        libpthread.so.0 = /lib64/libpthread.so.0 (0x7f0305a37000)
        /lib64/ld-linux-x86-64.so.2 (0x7f0307b51000)

I believe using libmm is optional, and the package maintainers
probably had their reasons not to use it anymore. Mine is also
compiled without libmm, though I'm on 5.3.10. Is it possible for you
to upgrade to the latest version? That might solve the problem too, if
not, I suggest to stick with the older one for a while. (and maybe
submit a bug report)

- Matijn

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



[PHP] php upload does not work proper, [tmp_name] and other are missing in $_FILES

2012-03-20 Thread Meike Stone
Hello,

I try the upload files, but in tmp_name and other variables are
missing in $_FILES.
I use php 5.3.8 on SLES11SP2

I can repeat this with:
===
?php
if(isset($_FILES)) {
var_dump($_FILES);
}
?
!-- The data encoding type, enctype, MUST be specified as below --

form enctype=multipart/form-data action=/i3.php method=POST

   !-- MAX_FILE_SIZE must precede the file input field --

   input type=hidden name=MAX_FILE_SIZE value=3 /

   !-- Name of input element determines name in $_FILES array --

   Send this file: input name=userfile type=file /

input type=submit value=Send File /

/form
===

The $_FILES shows only:
array(1) { [userfile]= array(1) { [name]= string(14) ask_script.xml } }

I traced (strace) the apache process, and I saw, that a temporary
file was opened, the text from the file written and than later
unlinked.

What can be the problem?



Kindly regards

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



Re: [PHP] php upload does not work proper, [tmp_name] and other are missing in $_FILES

2012-03-20 Thread Matijn Woudt
On Tue, Mar 20, 2012 at 4:33 PM, Meike Stone meike.st...@googlemail.com wrote:
 Hello,

 I try the upload files, but in tmp_name and other variables are
 missing in $_FILES.
 I use php 5.3.8 on SLES11SP2

 I can repeat this with:
 ===
 ?php
 if(isset($_FILES)) {
 var_dump($_FILES);
 }
 ?
 !-- The data encoding type, enctype, MUST be specified as below --

 form enctype=multipart/form-data action=/i3.php method=POST

   !-- MAX_FILE_SIZE must precede the file input field --

   input type=hidden name=MAX_FILE_SIZE value=3 /

   !-- Name of input element determines name in $_FILES array --

   Send this file: input name=userfile type=file /

 input type=submit value=Send File /

 /form
 ===

 The $_FILES shows only:
 array(1) { [userfile]= array(1) { [name]= string(14) ask_script.xml } 
 }

 I traced (strace) the apache process, and I saw, that a temporary
 file was opened, the text from the file written and than later
 unlinked.

 What can be the problem?



 Kindly regards

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


First of all, check your apache log files for any hints. There's
probably a warning/error in there that explains why.
If not, check your php.ini settings, there are a few settings that can
affect uploads (see [1]).

- Matijn

[1] http://nl3.php.net/manual/en/ini.core.php#ini.sect.file-uploads

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



Re: [PHP] php upload does not work proper, [tmp_name] and other are missing in $_FILES

2012-03-20 Thread Meike Stone

 First of all, check your apache log files for any hints. There's
 probably a warning/error in there that explains why.

I switched to LogLevel debug but in error_log is nothing found,
the access_log showes only:
192.168.1.89 - - [20/Mar/2012:16:43:53 +0100] POST /i3.php HTTP/1.1
200 539 http://172.16.1.170/i3.php; Mozilla/5.0 (Windows NT 5.1;
WOW64; rv:11.0) Gecko/20100101 Firefox/11.0

 If not, check your php.ini settings, there are a few settings that can
 affect uploads (see [1]).

 [1] http://nl3.php.net/manual/en/ini.core.php#ini.sect.file-uploads

Yes, I know this settings and checked this and disabled suhosin too.
Nothing helped.
I did this before stracing ...


Thanks Meike

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



[PHP] Upload size limit stays at 8MB

2011-05-06 Thread James Moe
Hello,
  apache v2.2.15 (Linux/SUSE)
  phpv5.3.3
  linux  v2.6.34.7-0.7-desktop #1 SMP

  I updated /etc/php5/apache2/php.ini to change
upload_max_filesize = 2M
to
upload_max_filesize = 60M.
  php_info() shows the changed value; echo
ini_get(upload_max_filesize) shows the changed value. Yet when I
attempt an upload, I get this in the error log:

PHP Warning:  POST Content-Length of 39246714 bytes exceeds the limit of
8388608 bytes in Unknown on line 0, referer: http://www.sma.com/sma/upload/

  Hmm. Unknown on line 0? A bit vague.
  8MB max seems a bit less than the 60MB listed.
  Where else could PHP be getting settings info?


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



RE: [PHP] Upload size limit stays at 8MB

2011-05-06 Thread Ross Hansen

Hey,

There is also an option for post_max_size = xM
x being the number specified.
This should be located in your php.ini file somewhere. check to make sure that 
this is set high enough else it could also be causing the issue.



 To: php-general@lists.php.net
 Date: Thu, 5 May 2011 21:51:26 -0700
 From: ji...@sohnen-moe.com
 Subject: [PHP] Upload size limit stays at 8MB
 
 Hello,
   apache v2.2.15 (Linux/SUSE)
   phpv5.3.3
   linux  v2.6.34.7-0.7-desktop #1 SMP
 
   I updated /etc/php5/apache2/php.ini to change
 upload_max_filesize = 2M
 to
 upload_max_filesize = 60M.
   php_info() shows the changed value; echo
 ini_get(upload_max_filesize) shows the changed value. Yet when I
 attempt an upload, I get this in the error log:
 
 PHP Warning:  POST Content-Length of 39246714 bytes exceeds the limit of
 8388608 bytes in Unknown on line 0, referer: http://www.sma.com/sma/upload/
 
   Hmm. Unknown on line 0? A bit vague.
   8MB max seems a bit less than the 60MB listed.
   Where else could PHP be getting settings info?
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
  

RE: [PHP] Upload size limit stays at 8MB

2011-05-06 Thread Ross Hansen

Apart from the possible security issues with posting content or information i 
don't believe that there is any others for posting large amounts of 
information. Just as long as you are aware that it is all being posted over 
plain text so if you have any sensitive data you may want to look at setting up 
a HTTPS.

otherwise, glad to know that your issues is solved. :)

 Date: Fri, 6 May 2011 10:10:31 -0700
 From: ji...@sohnen-moe.com
 To: hansen.r...@live.com.au
 Subject: Re: [PHP] Upload size limit stays at 8MB
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 On 05/05/2011 11:52 PM, Ross Hansen wrote:
  
  There is also an option for post_max_size = xM
  x being the number specified.
  This should be located in your php.ini file somewhere. check to make sure 
  that this is set high enough else it could also be causing the issue.
  
   Okay, that was it. Thanks!
   Are the any security issues with allowing a large POST size?
 
 - -- 
 James Moe
 moe dot james at sohnen-moe dot com
 520.743.3936
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v2.0.15 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iEYEARECAAYFAk3EK4cACgkQzTcr8Prq0ZMB7ACdEhMzHq40Gp8GzFjf+9SAeshc
 NMsAnAhOxVtDDXj7yPSrmh7LjR3UcYlY
 =ariZ
 -END PGP SIGNATURE-
  

Re: [PHP] upload big files

2011-04-17 Thread Tolas Anon
On Thu, Apr 14, 2011 at 10:36 AM, Ricardo Martinez harisel...@gmail.com wrote:
 Hi List!

 Need can upload big files ( around 300MB ) the system must be easy of use (
 cann't use ftp ).

 Was thinking in make it, using a form with post, and update the cfg files
 for can upload big files.
 But don't know how it going to work. I think that can give a lot of errors
 or be unestable.

 Just asking if anyone had a project like this one ;)

 Greetings!


I've got good experiences with http://jumploader.com
It's Java, and can do HTTP uploads  2Gb fine, with the partitioned php uploader

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



Re: [PHP] upload big files

2011-04-17 Thread Ricardo Martinez
thanks guys for answer,

i'm thinking in use FTP with PHP, never did it before, but don't must be
dificult.
I'll tell to you as finished it ;)

thanks!

On Sat, Apr 16, 2011 at 3:54 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:

  On Sat, 2011-04-16 at 15:47 +0200, Daniel Jost wrote:

 okay, sorry, you are right. i thought it would be purely javascript but
 forgot the flash component.



  but if you don't want your user to blindly upload 300mb over hours
 (depending on his internet connection) there are no other possibilities than
 using one of that components. or does anyone have another solution?

  2011/4/16 Ashley Sheridan a...@ashleysheridan.co.uk


   On Sat, 2011-04-16 at 15:36 +0200, Daniel Jost wrote:

 hi!

 this form would not really be a nice solution to upload 300mb. there would
 be no progress bar and no other possibility for the user to get feedback.

 you should consider to use a java uploaded - or a bit nicer - a javascript
 based solution like this: http://www.uploadify.com/

 http://www.uploadify.com/daniel

 2011/4/14 Ricardo Martinez harisel...@gmail.com

  Hi List!
 
  Need can upload big files ( around 300MB ) the system must be easy of use (
  cann't use ftp ).
 
  Was thinking in make it, using a form with post, and update the cfg files
  for can upload big files.
  But don't know how it going to work. I think that can give a lot of errors
  or be unestable.
 
  Just asking if anyone had a project like this one ;)
 
  Greetings!
 
  --
  Ricardo
  ___
  IT Architect
  website: http://www.pulsarinara.com
 



   Uploadify might appear to be purely Javascript, but it is in-fact Flash
 doing the actual upload work. I've used this before, and found it impossible
 to use without a mouse and defaults to a standard upload input element if
 you don't have Flash player installed on that browser. These might not seem
 like major issues, but I for one don't have Flash installed on my Windows
 partition (found it to be too much of a security risk) and there are plenty
 of people out there who can't use a mouse due to various disabilities. I'd
 definitely go with the Java one if you can, as this is more portable (I
 believe you can get them to run on iOS devices where Flash would be a no-go)
 and would allow non-mouse navigation.

 Having said that, the last time I used Uploadify was about a year ago, so
 things may have changed since then with regards to the non-mouse
 interaction.


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







 The last time I had to do something like this was for large video files
 which could sometimes go beyond 2GB. In the end I allowed the files to be
 transferred over FTP (with the same username/password that they logged in
 via the web interface), but also included a Java applet in the web interface
 as well so that it appeared to allow the upload as normal, but behind the
 scenes it was all FTP. HTTP isn't great for large uploads, but a protocol
 like FTP is perfectly suited for it.


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





-- 
Ricardo
___
IT Architect
website: http://www.pulsarinara.com


Re: [PHP] upload big files

2011-04-17 Thread Ashley Sheridan
On Sun, 2011-04-17 at 19:12 +0200, Ricardo Martinez wrote:

 thanks guys for answer,
 
 i'm thinking in use FTP with PHP, never did it before, but don't must be
 dificult.
 I'll tell to you as finished it ;)
 
 thanks!
 
 On Sat, Apr 16, 2011 at 3:54 PM, Ashley Sheridan
 a...@ashleysheridan.co.ukwrote:
 
   On Sat, 2011-04-16 at 15:47 +0200, Daniel Jost wrote:
 
  okay, sorry, you are right. i thought it would be purely javascript but
  forgot the flash component.
 
 
 
   but if you don't want your user to blindly upload 300mb over hours
  (depending on his internet connection) there are no other possibilities than
  using one of that components. or does anyone have another solution?
 
   2011/4/16 Ashley Sheridan a...@ashleysheridan.co.uk
 
 
On Sat, 2011-04-16 at 15:36 +0200, Daniel Jost wrote:
 
  hi!
 
  this form would not really be a nice solution to upload 300mb. there would
  be no progress bar and no other possibility for the user to get feedback.
 
  you should consider to use a java uploaded - or a bit nicer - a javascript
  based solution like this: http://www.uploadify.com/
 
  http://www.uploadify.com/daniel
 
  2011/4/14 Ricardo Martinez harisel...@gmail.com
 
   Hi List!
  
   Need can upload big files ( around 300MB ) the system must be easy of use 
   (
   cann't use ftp ).
  
   Was thinking in make it, using a form with post, and update the cfg files
   for can upload big files.
   But don't know how it going to work. I think that can give a lot of errors
   or be unestable.
  
   Just asking if anyone had a project like this one ;)
  
   Greetings!
  
   --
   Ricardo
   ___
   IT Architect
   website: http://www.pulsarinara.com
  
 
 
 
Uploadify might appear to be purely Javascript, but it is in-fact Flash
  doing the actual upload work. I've used this before, and found it impossible
  to use without a mouse and defaults to a standard upload input element if
  you don't have Flash player installed on that browser. These might not seem
  like major issues, but I for one don't have Flash installed on my Windows
  partition (found it to be too much of a security risk) and there are plenty
  of people out there who can't use a mouse due to various disabilities. I'd
  definitely go with the Java one if you can, as this is more portable (I
  believe you can get them to run on iOS devices where Flash would be a no-go)
  and would allow non-mouse navigation.
 
  Having said that, the last time I used Uploadify was about a year ago, so
  things may have changed since then with regards to the non-mouse
  interaction.
 
 
--
  Thanks,
  Ash
  http://www.ashleysheridan.co.uk
 
 
 
 
 
 
 
  The last time I had to do something like this was for large video files
  which could sometimes go beyond 2GB. In the end I allowed the files to be
  transferred over FTP (with the same username/password that they logged in
  via the web interface), but also included a Java applet in the web interface
  as well so that it appeared to allow the upload as normal, but behind the
  scenes it was all FTP. HTTP isn't great for large uploads, but a protocol
  like FTP is perfectly suited for it.
 
 
--
  Thanks,
  Ash
  http://www.ashleysheridan.co.uk
 
 
 
 
 


The FTP functions in PHP are just for connecting to an FTP server from
PHP, which itself is run on a server, so you won't be able to use those
functions to allow people to upload files to your server.
-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] upload big files

2011-04-16 Thread Daniel Jost
hi!

this form would not really be a nice solution to upload 300mb. there would
be no progress bar and no other possibility for the user to get feedback.

you should consider to use a java uploaded - or a bit nicer - a javascript
based solution like this: http://www.uploadify.com/

http://www.uploadify.com/daniel

2011/4/14 Ricardo Martinez harisel...@gmail.com

 Hi List!

 Need can upload big files ( around 300MB ) the system must be easy of use (
 cann't use ftp ).

 Was thinking in make it, using a form with post, and update the cfg files
 for can upload big files.
 But don't know how it going to work. I think that can give a lot of errors
 or be unestable.

 Just asking if anyone had a project like this one ;)

 Greetings!

 --
 Ricardo
 ___
 IT Architect
 website: http://www.pulsarinara.com



Re: [PHP] upload big files

2011-04-16 Thread Ashley Sheridan
On Sat, 2011-04-16 at 15:36 +0200, Daniel Jost wrote:

 hi!
 
 this form would not really be a nice solution to upload 300mb. there would
 be no progress bar and no other possibility for the user to get feedback.
 
 you should consider to use a java uploaded - or a bit nicer - a javascript
 based solution like this: http://www.uploadify.com/
 
 http://www.uploadify.com/daniel
 
 2011/4/14 Ricardo Martinez harisel...@gmail.com
 
  Hi List!
 
  Need can upload big files ( around 300MB ) the system must be easy of use (
  cann't use ftp ).
 
  Was thinking in make it, using a form with post, and update the cfg files
  for can upload big files.
  But don't know how it going to work. I think that can give a lot of errors
  or be unestable.
 
  Just asking if anyone had a project like this one ;)
 
  Greetings!
 
  --
  Ricardo
  ___
  IT Architect
  website: http://www.pulsarinara.com
 


Uploadify might appear to be purely Javascript, but it is in-fact Flash
doing the actual upload work. I've used this before, and found it
impossible to use without a mouse and defaults to a standard upload
input element if you don't have Flash player installed on that browser.
These might not seem like major issues, but I for one don't have Flash
installed on my Windows partition (found it to be too much of a security
risk) and there are plenty of people out there who can't use a mouse due
to various disabilities. I'd definitely go with the Java one if you can,
as this is more portable (I believe you can get them to run on iOS
devices where Flash would be a no-go) and would allow non-mouse
navigation.

Having said that, the last time I used Uploadify was about a year ago,
so things may have changed since then with regards to the non-mouse
interaction.


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




Re: [PHP] upload big files

2011-04-16 Thread Daniel Jost
okay, sorry, you are right. i thought it would be purely javascript but
forgot the flash component.

but if you don't want your user to blindly upload 300mb over hours
(depending on his internet connection) there are no other possibilities than
using one of that components. or does anyone have another solution?

2011/4/16 Ashley Sheridan a...@ashleysheridan.co.uk

  On Sat, 2011-04-16 at 15:36 +0200, Daniel Jost wrote:

 hi!

 this form would not really be a nice solution to upload 300mb. there would
 be no progress bar and no other possibility for the user to get feedback.

 you should consider to use a java uploaded - or a bit nicer - a javascript
 based solution like this: http://www.uploadify.com/

 http://www.uploadify.com/daniel

 2011/4/14 Ricardo Martinez harisel...@gmail.com

  Hi List!
 
  Need can upload big files ( around 300MB ) the system must be easy of use (
  cann't use ftp ).
 
  Was thinking in make it, using a form with post, and update the cfg files
  for can upload big files.
  But don't know how it going to work. I think that can give a lot of errors
  or be unestable.
 
  Just asking if anyone had a project like this one ;)
 
  Greetings!
 
  --
  Ricardo
  ___
  IT Architect
  website: http://www.pulsarinara.com
 


 Uploadify might appear to be purely Javascript, but it is in-fact Flash
 doing the actual upload work. I've used this before, and found it impossible
 to use without a mouse and defaults to a standard upload input element if
 you don't have Flash player installed on that browser. These might not seem
 like major issues, but I for one don't have Flash installed on my Windows
 partition (found it to be too much of a security risk) and there are plenty
 of people out there who can't use a mouse due to various disabilities. I'd
 definitely go with the Java one if you can, as this is more portable (I
 believe you can get them to run on iOS devices where Flash would be a no-go)
 and would allow non-mouse navigation.

 Having said that, the last time I used Uploadify was about a year ago, so
 things may have changed since then with regards to the non-mouse
 interaction.


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





Re: [PHP] upload big files

2011-04-16 Thread Ashley Sheridan
On Sat, 2011-04-16 at 15:47 +0200, Daniel Jost wrote:

 okay, sorry, you are right. i thought it would be purely javascript
 but forgot the flash component.
 
 
 
 but if you don't want your user to blindly upload 300mb over hours
 (depending on his internet connection) there are no other
 possibilities than using one of that components. or does anyone have
 another solution?
 
 
 2011/4/16 Ashley Sheridan a...@ashleysheridan.co.uk
 
 
 On Sat, 2011-04-16 at 15:36 +0200, Daniel Jost wrote: 
 
  hi!
  
  this form would not really be a nice solution to upload 300mb. 
 there would
  be no progress bar and no other possibility for the user to get 
 feedback.
  
  you should consider to use a java uploaded - or a bit nicer - a 
 javascript
  based solution like this: http://www.uploadify.com/
  
  http://www.uploadify.com/daniel
  
  2011/4/14 Ricardo Martinez harisel...@gmail.com
  
   Hi List!
  
   Need can upload big files ( around 300MB ) the system must be 
 easy of use (
   cann't use ftp ).
  
   Was thinking in make it, using a form with post, and update the 
 cfg files
   for can upload big files.
   But don't know how it going to work. I think that can give a lot 
 of errors
   or be unestable.
  
   Just asking if anyone had a project like this one ;)
  
   Greetings!
  
   --
   Ricardo
   ___
   IT Architect
   website: http://www.pulsarinara.com
  
 
 
 
 
 Uploadify might appear to be purely Javascript, but it is
 in-fact Flash doing the actual upload work. I've used this
 before, and found it impossible to use without a mouse and
 defaults to a standard upload input element if you don't have
 Flash player installed on that browser. These might not seem
 like major issues, but I for one don't have Flash installed on
 my Windows partition (found it to be too much of a security
 risk) and there are plenty of people out there who can't use a
 mouse due to various disabilities. I'd definitely go with the
 Java one if you can, as this is more portable (I believe you
 can get them to run on iOS devices where Flash would be a
 no-go) and would allow non-mouse navigation.
 
 Having said that, the last time I used Uploadify was about a
 year ago, so things may have changed since then with regards
 to the non-mouse interaction.
 
 
 -- 
 Thanks,
 Ash
 http://www.ashleysheridan.co.uk
 
 
 
 
 
 


The last time I had to do something like this was for large video files
which could sometimes go beyond 2GB. In the end I allowed the files to
be transferred over FTP (with the same username/password that they
logged in via the web interface), but also included a Java applet in the
web interface as well so that it appeared to allow the upload as normal,
but behind the scenes it was all FTP. HTTP isn't great for large
uploads, but a protocol like FTP is perfectly suited for it.

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




[PHP] upload big files

2011-04-14 Thread Ricardo Martinez
Hi List!

Need can upload big files ( around 300MB ) the system must be easy of use (
cann't use ftp ).

Was thinking in make it, using a form with post, and update the cfg files
for can upload big files.
But don't know how it going to work. I think that can give a lot of errors
or be unestable.

Just asking if anyone had a project like this one ;)

Greetings!

-- 
Ricardo
___
IT Architect
website: http://www.pulsarinara.com


RE: [PHP] Upload Progress Meter

2011-03-24 Thread Brad Broerman
Essentially, they all require Flash or Java... 

Most use Flash...  

If you want one that is in Java, and is scriptable in JavaScript, I have one
on my website: http://www.bbroerman.net/code.html

-Brad


-Original Message-
From: Floyd Resler [mailto:fres...@adex-intl.com] 
Sent: Wednesday, March 23, 2011 10:29 AM
To: sstap...@mnsi.net
Cc: PHP
Subject: Re: [PHP] Upload Progress Meter


On Mar 23, 2011, at 10:10 AM, Steve Staples wrote:

 On Wed, 2011-03-23 at 09:59 -0400, Floyd Resler wrote:
 I am in need of an upload progress meter.  I've seen plenty of tutorials
=
 on-line requiring installing modules, hooks, patches, etc.  However, my =
 Wordpress install accomplished this without me having to make any =
 modifications to my PHP install.  So, how is it done?
 
 Thanks!
 Floyd
 
 
 you can google this...
 
 jquery upload progress meter
 
 or:
 http://www.nixboxdesigns.com/demos/jquery-uploadprogress.php
 
 http://www.bitrepository.com/uploading-files-with-progress-bar.html
 
 
 
 Steve
 

I'll check it out!

Thanks!
Floyd




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



Re: [PHP] Upload Progress Meter

2011-03-24 Thread Donovan Brooke

Brad Broerman wrote:

Essentially, they all require Flash or Java...



You are generally talking about two different sides of the client/server 
relationship.. unless you are talking about Applets, right?... so I have 
an issue with the statement. If jquery does one (as mentioned), it's 
likely not Flash nor Java.


I'm not trying to be an arse or anything, but I don't see it being that 
limiting. I do think it's difficult to recommend a progress meter when 
there is not a lot of

info given of what is being metered. If you need to meter the processes
for javascript, then you'd likely use javascript, if you need to meter
a server-side intensive task, then you could use a server-side method, 
or a combination of things.


It all comes down to a pretty graphic to watch while your waiting for a 
task to finish. ;-)


Donovan




--
D Brooke

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



[PHP] Upload Progress Meter

2011-03-23 Thread Floyd Resler
I am in need of an upload progress meter.  I've seen plenty of tutorials =
on-line requiring installing modules, hooks, patches, etc.  However, my =
Wordpress install accomplished this without me having to make any =
modifications to my PHP install.  So, how is it done?

Thanks!
Floyd

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



Re: [PHP] Upload Progress Meter

2011-03-23 Thread Steve Staples
On Wed, 2011-03-23 at 09:59 -0400, Floyd Resler wrote:
 I am in need of an upload progress meter.  I've seen plenty of tutorials =
 on-line requiring installing modules, hooks, patches, etc.  However, my =
 Wordpress install accomplished this without me having to make any =
 modifications to my PHP install.  So, how is it done?
 
 Thanks!
 Floyd
 

you can google this...

jquery upload progress meter

or:
http://www.nixboxdesigns.com/demos/jquery-uploadprogress.php

http://www.bitrepository.com/uploading-files-with-progress-bar.html



Steve


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



Re: [PHP] Upload Progress Meter

2011-03-23 Thread Floyd Resler

On Mar 23, 2011, at 10:10 AM, Steve Staples wrote:

 On Wed, 2011-03-23 at 09:59 -0400, Floyd Resler wrote:
 I am in need of an upload progress meter.  I've seen plenty of tutorials =
 on-line requiring installing modules, hooks, patches, etc.  However, my =
 Wordpress install accomplished this without me having to make any =
 modifications to my PHP install.  So, how is it done?
 
 Thanks!
 Floyd
 
 
 you can google this...
 
 jquery upload progress meter
 
 or:
 http://www.nixboxdesigns.com/demos/jquery-uploadprogress.php
 
 http://www.bitrepository.com/uploading-files-with-progress-bar.html
 
 
 
 Steve
 

I'll check it out!

Thanks!
Floyd



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



[PHP] Upload using FTP commands

2010-08-26 Thread Matthew Croud


Hi,

I want to give my client the ability to upload large files ( around  
20MB ) to a webspace.
I reckon that using the FTP commands of PHP would be the best bet, but  
is it possible to allow them to do this through an online form.


This is my vision: the client logs in to a form that has an upload  
button, and the upload button uses the FTP commands to upload the file.


Is that do-able in PHP ?

Cheers!







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



Re: [PHP] Upload using FTP commands

2010-08-26 Thread Dan McCullough
Take a look here:
http://us.php.net/manual/en/ref.ftp.php

You might have some issues with the memory limit in PHP so that might have
to be boosted for 20MB files.

On Thu, Aug 26, 2010 at 12:24 PM, Matthew Croud m...@obviousdigital.comwrote:


 Hi,

 I want to give my client the ability to upload large files ( around 20MB )
 to a webspace.
 I reckon that using the FTP commands of PHP would be the best bet, but is
 it possible to allow them to do this through an online form.

 This is my vision: the client logs in to a form that has an upload button,
 and the upload button uses the FTP commands to upload the file.

 Is that do-able in PHP ?

 Cheers!







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




Re: [PHP] Upload using FTP commands

2010-08-26 Thread Ashley Sheridan
On Thu, 2010-08-26 at 17:24 +0100, Matthew Croud wrote:

 Hi,
 
 I want to give my client the ability to upload large files ( around  
 20MB ) to a webspace.
 I reckon that using the FTP commands of PHP would be the best bet, but  
 is it possible to allow them to do this through an online form.
 
 This is my vision: the client logs in to a form that has an upload  
 button, and the upload button uses the FTP commands to upload the file.
 
 Is that do-able in PHP ?
 
 Cheers!
 
 
 
 
 
 
 

What would be the point?

You would have to set up your server to allow large files to be uploaded
in order for them to be used by PHP, and by that time, unless you're
putting them onto a remote server, there's no point in using the FTP
functions of PHP. What I've found quite reliable is to use PHP to create
FTP user accounts, which they can then log in to and upload files as
they need.

HTTP was not really intended for uploading large files, but FTP is, and
every OS has some form of FTP software built in that can be used very
easily.

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




Re: [PHP] Upload using FTP commands

2010-08-26 Thread Adam Richardson
On Thu, Aug 26, 2010 at 12:37 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:

 On Thu, 2010-08-26 at 17:24 +0100, Matthew Croud wrote:

  Hi,
 
  I want to give my client the ability to upload large files ( around
  20MB ) to a webspace.
  I reckon that using the FTP commands of PHP would be the best bet, but
  is it possible to allow them to do this through an online form.
 
  This is my vision: the client logs in to a form that has an upload
  button, and the upload button uses the FTP commands to upload the file.
 
  Is that do-able in PHP ?
 
  Cheers!
 
 
 
 
 
 
 

 What would be the point?

 You would have to set up your server to allow large files to be uploaded
 in order for them to be used by PHP, and by that time, unless you're
 putting them onto a remote server, there's no point in using the FTP
 functions of PHP.


Ashley makes a nice point.  When I have control over the server, I don't use
PHP's FTP capabilities at all.  However, on some shared severs you're only
HTTP upload options are to set a directory to 777 (Yikes!), or do some work
with PHP's FTP functions.

What I've done in the past on shared hosts is setup an upload FTP account
that has access to one directory.  Then, I develop a form to upload the
file.  Once a file is uploaded, I use PHP's FTP functions to place the file
in the directory.  This way I avoid the security issues of 777, maintain an
easy-to-use interface (some clients don't want to use FTP), and continue to
use the hosting the client prefers.  There is a cost to this method, but
sometimes it's worth the cost.

Just another way of doing things.

Adam

-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com


[PHP] PHP upload hangs on Safari

2010-08-14 Thread Don Wieland

Hi,

I have a page that has 9 form actions which upload individual files  
one at a time. On my own server, it runs fine and there are no hangs.  
But when I install on my clients server. I creased their  
upload_max_filesize to 100MB.


Still I get random hanging.

Is there any thing else that I should be looking at to remedy this  
hanging?


Don Wieland
D W   D a t a   C o n c e p t s
~
d...@dwdataconcepts.com
Direct Line - (949) 305-2771

Integrated data solutions to fit your business needs.

Need assistance in dialing in your FileMaker solution? Check out our  
Developer Support Plan at:

http://www.dwdataconcepts.com/DevSup.html

Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro  
9 or higher

http://www.appointment10.com

For a quick overview -
http://www.appointment10.com/Appt10_Promo/Overview.html



Re: [PHP] PHP upload hangs on Safari

2010-08-14 Thread Ashley Sheridan
On Sat, 2010-08-14 at 08:08 -0700, Don Wieland wrote:

 Hi,
 
 I have a page that has 9 form actions which upload individual files  
 one at a time. On my own server, it runs fine and there are no hangs.  
 But when I install on my clients server. I creased their  
 upload_max_filesize to 100MB.
 
 Still I get random hanging.
 
 Is there any thing else that I should be looking at to remedy this  
 hanging?
 
 Don Wieland
 D W   D a t a   C o n c e p t s
 ~
 d...@dwdataconcepts.com
 Direct Line - (949) 305-2771
 
 Integrated data solutions to fit your business needs.
 
 Need assistance in dialing in your FileMaker solution? Check out our  
 Developer Support Plan at:
 http://www.dwdataconcepts.com/DevSup.html
 
 Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro  
 9 or higher
 http://www.appointment10.com
 
 For a quick overview -
 http://www.appointment10.com/Appt10_Promo/Overview.html
 


So, is it one form with 9 input type=file/ elements, or 9 forms, as
I was a little unsure from your email.

Are you sure it's hanging? Have you given enough time for the files to
transfer over the Internet? Is it only Safari that it appears to hang
with? Try using Firefox with Firebug installed to see what client-server
communication is actually going on, as that might show you where any
problem is.

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




[PHP] upload directly into a resource?

2010-05-03 Thread Paul Halliday
I have some code that is currently static. It runs via Cron,
generating images which can then be viewed via some other PHP.

What I want to do is allow a user to upload data which I can then pipe
directly into the existing program to produce on the fly images. I am
looking at this:

http://www.php.net/manual/en/features.file-upload.post-method.php

My existing code looks like this:

$theData = aQuery($gType, $gSdate, $gStime, $gEdate, $gEtime, $gFilter, $base);

while ($row = mysql_fetch_array($theData[0])) {

$hit = yes;

$src_ip[] = $row[0];
$dst_ip[] = $row[1];
$sig_desc[] = wordwrap($row[2],20,\\n);

if ($gType == 02) {
$hit_count[] = $row[3];
}

$rec ++;
if ( $rec == $recCount ) {
break;
}

}

// Open Afterglow and feed it our results

$glowCmd = $glowPath -c $glowProps $glowArgs | $dotPath $dotArgs $dotOut;

$dspec = array(
0 = array(pipe, r),
1 = array(pipe, w),
2 = array(file, $glowErr, a)
);

$process = proc_open($glowCmd, $dspec, $pipes, $baseDir);


If you are following the gist, what is the easiest way to put the
uploaded file into $theData?

aQuery just returns the result of a mysql select; so is it just a
matter of using fgetcsv as the action in the stub taken from the file
upload link?

Thanks.

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



[PHP] Upload file on IE8

2010-01-25 Thread Ernie Kemp
 

Good Day,

 

I'm having an issue with IE8, when I go to load a file the
program is not filling the $_FILES['user_file']['type']  .

  When I display  echo  Start.$_FILES['pix']['type'].End;
in IE8 I get StartEnd with nothing in between.  I expected image/pjpeg.
 
On FireFox I get image/jpeg.
 
Any suggestions?
Thanks,
/Ernie
 

 

 

 

 

 



Re: [PHP] Upload file on IE8

2010-01-25 Thread Ashley Sheridan
On Mon, 2010-01-25 at 17:41 -0500, Ernie Kemp wrote:

 
 
 Good Day,
 
  
 
 I’m having an issue with IE8, when I go to load a file
 the program is not filling the $_FILES['user_file']['type']  .
 
 
   When I display  “echo  Start.$_FILES['pix']['type'].End;”  
 in IE8 I get “StartEnd” with nothing in between.  I expected “image/pjpeg.
  
 On FireFox I get “image/jpeg.
  
 Any suggestions?
 Thanks,
 /Ernie
  
 
 
  

What do the other $_FILES fields say? Are they populated correctly?

I wouldn't rely on anything sent from the browser. IE is known to send
the mime type that matches the extension, not the contents of the file,
and for .jpg images it sends a different mime to every other browser
anyway, so it's pretty unreliable.

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




Re: [PHP] Upload file on IE8

2010-01-25 Thread Eric Lee
On Tue, Jan 26, 2010 at 6:41 AM, Ernie Kemp ernie.k...@sympatico.ca wrote:

   Good Day,



 I’m having an issue with IE8, when I go to load a file the
 program is not filling the $_FILES['user_file']['type']  .

   When I display  “echo  Start.$_FILES['pix']['type'].End;”  
 in IE8 I get “StartEnd” with nothing in between.  I expected “image/pjpeg.



 On FireFox I get “image/jpeg.



 Any suggestions?

 Thanks,

 /Ernie



  I remember a setting from some elsewhere IE 8 was disable set file path
 location
 by default from the options dialog. Did you enabled this already ? If not,
 you may give it a shoot to see than !


 Hope this help


 Eric,
 Regards,









Re: [PHP] Upload file on IE8

2010-01-25 Thread Ashley Sheridan
On Tue, 2010-01-26 at 07:33 +0800, Eric Lee wrote:

 On Tue, Jan 26, 2010 at 6:41 AM, Ernie Kemp ernie.k...@sympatico.ca wrote:
 
Good Day,
 
 
 
  I’m having an issue with IE8, when I go to load a file the
  program is not filling the $_FILES['user_file']['type']  .
 
When I display  “echo  Start.$_FILES['pix']['type'].End;” 
   in IE8 I get “StartEnd” with nothing in between.  I expected “image/pjpeg.
 
 
 
  On FireFox I get “image/jpeg.
 
 
 
  Any suggestions?
 
  Thanks,
 
  /Ernie
 
 
 
   I remember a setting from some elsewhere IE 8 was disable set file path
  location
  by default from the options dialog. Did you enabled this already ? If not,
  you may give it a shoot to see than !
 
 
  Hope this help
 
 
  Eric,
  Regards,
 
 
 
 
 
 
 


But you won't be able to guarantee every IE8 user will do this, so you
shouldn't develop the app in such a way that it needs to use the value
in the array. Also, as I've said, there isn't much point relying on this
value for any reason anyway, as it doesn't guarantee the file is
actually of that type.

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




RE: [PHP] Upload file on IE8

2010-01-25 Thread Ernie Kemp
 

 

 

 

From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] 
Sent: January-25-10 5:53 PM
To: Ernie Kemp
Cc: 'PHP General List'
Subject: Re: [PHP] Upload file on IE8

 

On Mon, 2010-01-25 at 17:41 -0500, Ernie Kemp wrote:



 

Good Day,

 

I’m having an issue with IE8, when I go to load a file the 
program is not filling the $_FILES['user_file']['type']  .

 
  When I display  “echo  Start.$_FILES['pix']['type'].End;”  in 
IE8 I get “StartEnd” with nothing in between.  I expected “image/pjpeg.
 
On FireFox I get “image/jpeg.
 
Any suggestions?
Thanks,
/Ernie
 

 

What do the other $_FILES fields say? Are they populated correctly?

I wouldn't rely on anything sent from the browser. IE is known to send the mime 
type that matches the extension, not the contents of the file, and for .jpg 
images it sends a different mime to every other browser anyway, so it's pretty 
unreliable. 


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





With IE8,

  Using $_FILES the array results for  ‘name’ has the name of the file but 
‘type’, ‘tmp_name’ and ‘size’ are blanks.

 I tried enabling the “file path location” in IE8 option but the results 
are the same for $_FILES. 

 


   Firefox works displays all the values in the $_FILES array.

There must be a better way. Suggestions?

Thanks,

/Ernie



RE: [PHP] Upload file on IE8

2010-01-25 Thread Ashley Sheridan
On Mon, 2010-01-25 at 19:21 -0500, Ernie Kemp wrote:

 
 
 
 
 
 
 
 From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] 
 Sent: January-25-10 5:53 PM
 To: Ernie Kemp
 Cc: 'PHP General List'
 Subject: Re: [PHP] Upload file on IE8
 
  
 
 On Mon, 2010-01-25 at 17:41 -0500, Ernie Kemp wrote:
 
 
 
  
 
 Good Day,
 
  
 
 I’m having an issue with IE8, when I go to load a file the 
 program is not filling the $_FILES['user_file']['type']  .
 
  
   When I display  “echo  Start.$_FILES['pix']['type'].End;”  
 in IE8 I get “StartEnd” with nothing in between.  I expected “image/pjpeg.
  
 On FireFox I get “image/jpeg.
  
 Any suggestions?
 Thanks,
 /Ernie
  
 
 
 
 What do the other $_FILES fields say? Are they populated correctly?
 
 I wouldn't rely on anything sent from the browser. IE is known to send the 
 mime type that matches the extension, not the contents of the file, and for 
 .jpg images it sends a different mime to every other browser anyway, so it's 
 pretty unreliable. 
 
 
 Thanks,
 Ash
 http://www.ashleysheridan.co.uk
 
 
 
 
 
 With IE8,
 
   Using $_FILES the array results for  ‘name’ has the name of the file 
 but ‘type’, ‘tmp_name’ and ‘size’ are blanks.
 
  I tried enabling the “file path location” in IE8 option but the results 
 are the same for $_FILES. 
 
  
 
 
Firefox works displays all the values in the $_FILES array.
 
 There must be a better way. Suggestions?
 
 Thanks,
 
 /Ernie
 


Don't use the value. There are a few different ways in PHP to get the
mime type of a file, which it does based on the contents of the file and
not its extension. This prevents someone from uploading an executable
virus for example by just changing the last three letters of the
filename.

Have a look at fileinfo() for this sort of thing.

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




Re: [PHP] Upload dir

2009-12-12 Thread Richard Quadling
2009/12/11 Ashley Sheridan a...@ashleysheridan.co.uk

 On Fri, 2009-12-11 at 15:44 +, Richard Quadling wrote:

 2009/12/11 kranthi kranthi...@gmail.com:
  How can i change the temporary upload directory?
  var_dump(ini_get('upload_tmp_dir'));      gives me (and that is set in 
  php.ini)
  string '/var/www/cgi-bin' (length=16)
 
  but
  var_dump($_FILES)                                                     gives 
  me
  'tmp_name' = string '/tmp/phpbSZ6WP' (length=14)
 
  var_dump(file_exists($_FILES['file']['tmp_name']));  gives me  (/tmp
  has permissions drwxrwxrwt and i never used file_move_upload or any
  similar functions)
  boolean false
 
  am I missing something here?
  Kranthi.
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 

 Just assuming you could alter the upload_tmp_dir setting in your code
 (you can't) ...

 PHP puts the uploaded files into the upload_tmp_dir BEFORE your script
 runs, so changing it in your script essentially hides the uploaded
 files.

 PHP drops the files into directory A.
 PHP then runs your code.
 Your code changes the directory to B.
 Your code cannot see the files PHP put into A as your code is now looking in 
 B.

 But, as I said earlier, you can't use your code to change
 upload_tmp_dir. It can only be done at the system level (php.ini or
 httpd.conf). See [1] and [2].

 Regards,

 Richard Quadling.

 [1] http://docs.php.net/manual/en/ini.core.php#ini.sect.file-uploads
 [2] http://docs.php.net/manual/en/configuration.changes.modes.php

 --
 -
 Richard Quadling
 Standing on the shoulders of some very clever giants!
 EE : http://www.experts-exchange.com/M_248814.html
 Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
 ZOPA : http://uk.zopa.com/member/RQuadling


 The only reason I can see for wanting to do this would be where several sites 
 exist on the same server and you might want each site to have its own 
 temporary upload directory. It won't have any bearing on how you handle the 
 uploads unless it becomes full.

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



Another way to handle this is via php.ini sections [1]

Regards,

Richard.

[1] http://docs.php.net/manual/en/ini.sections.php

--
-
Richard Quadling
Standing on the shoulders of some very clever giants!
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

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



Re: [PHP] Upload dir

2009-12-11 Thread kranthi
my mistake didn't use move_uploaded_file to see if the uploading
is working or not in the first case

but i could not understand why
   1. ini_get() is giving correct value while
$_FILES['file']['tmp_name'] is ignoring that.
   2. move_uploaded_file($_FILES['file']['tmp_name'], 'file.php'); is
working fine but file_exists($_FILES['file']['tmp_name']) is returning
false
   3. php_admin_value upload_tmp_dir /var/www/html
in httpd.conf seems to work ($_FILES['file']['tmp_name'] is not ignoring that);

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



Re: [PHP] Upload dir

2009-12-11 Thread Richard Quadling
2009/12/11 kranthi kranthi...@gmail.com:
 How can i change the temporary upload directory?
 var_dump(ini_get('upload_tmp_dir'));      gives me (and that is set in 
 php.ini)
 string '/var/www/cgi-bin' (length=16)

 but
 var_dump($_FILES)                                                     gives me
 'tmp_name' = string '/tmp/phpbSZ6WP' (length=14)

 var_dump(file_exists($_FILES['file']['tmp_name']));  gives me  (/tmp
 has permissions drwxrwxrwt and i never used file_move_upload or any
 similar functions)
 boolean false

 am I missing something here?
 Kranthi.

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



Just assuming you could alter the upload_tmp_dir setting in your code
(you can't) ...

PHP puts the uploaded files into the upload_tmp_dir BEFORE your script
runs, so changing it in your script essentially hides the uploaded
files.

PHP drops the files into directory A.
PHP then runs your code.
Your code changes the directory to B.
Your code cannot see the files PHP put into A as your code is now looking in B.

But, as I said earlier, you can't use your code to change
upload_tmp_dir. It can only be done at the system level (php.ini or
httpd.conf). See [1] and [2].

Regards,

Richard Quadling.

[1] http://docs.php.net/manual/en/ini.core.php#ini.sect.file-uploads
[2] http://docs.php.net/manual/en/configuration.changes.modes.php

-- 
-
Richard Quadling
Standing on the shoulders of some very clever giants!
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

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



Re: [PHP] Upload dir

2009-12-11 Thread Ashley Sheridan
On Fri, 2009-12-11 at 15:44 +, Richard Quadling wrote:

 2009/12/11 kranthi kranthi...@gmail.com:
  How can i change the temporary upload directory?
  var_dump(ini_get('upload_tmp_dir'));  gives me (and that is set in 
  php.ini)
  string '/var/www/cgi-bin' (length=16)
 
  but
  var_dump($_FILES) gives 
  me
  'tmp_name' = string '/tmp/phpbSZ6WP' (length=14)
 
  var_dump(file_exists($_FILES['file']['tmp_name']));  gives me  (/tmp
  has permissions drwxrwxrwt and i never used file_move_upload or any
  similar functions)
  boolean false
 
  am I missing something here?
  Kranthi.
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 Just assuming you could alter the upload_tmp_dir setting in your code
 (you can't) ...
 
 PHP puts the uploaded files into the upload_tmp_dir BEFORE your script
 runs, so changing it in your script essentially hides the uploaded
 files.
 
 PHP drops the files into directory A.
 PHP then runs your code.
 Your code changes the directory to B.
 Your code cannot see the files PHP put into A as your code is now looking in 
 B.
 
 But, as I said earlier, you can't use your code to change
 upload_tmp_dir. It can only be done at the system level (php.ini or
 httpd.conf). See [1] and [2].
 
 Regards,
 
 Richard Quadling.
 
 [1] http://docs.php.net/manual/en/ini.core.php#ini.sect.file-uploads
 [2] http://docs.php.net/manual/en/configuration.changes.modes.php
 
 -- 
 -
 Richard Quadling
 Standing on the shoulders of some very clever giants!
 EE : http://www.experts-exchange.com/M_248814.html
 Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
 ZOPA : http://uk.zopa.com/member/RQuadling
 


The only reason I can see for wanting to do this would be where several
sites exist on the same server and you might want each site to have its
own temporary upload directory. It won't have any bearing on how you
handle the uploads unless it becomes full.

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




[PHP] Upload dir

2009-12-10 Thread kranthi
How can i change the temporary upload directory?
var_dump(ini_get('upload_tmp_dir'));  gives me (and that is set in php.ini)
string '/var/www/cgi-bin' (length=16)

but
var_dump($_FILES) gives me
'tmp_name' = string '/tmp/phpbSZ6WP' (length=14)

var_dump(file_exists($_FILES['file']['tmp_name']));  gives me  (/tmp
has permissions drwxrwxrwt and i never used file_move_upload or any
similar functions)
boolean false

am I missing something here?
Kranthi.

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



Re: [PHP] Upload dir

2009-12-10 Thread Gaurav Kumar
OK you used ini_get try using ini_set and set the temporary directory on
your server of your choice at run time in your script (top of the script or
any config file if you have one).

REMEMBER that you have access to that directory, should have full
permissions and also check the absolute server path is correct while you set
the directory.


More information on how to use ini_set to set the directory path- try
googling...

Gaurav Kumar
blog.oswebstudio.com



On Fri, Dec 11, 2009 at 10:59 AM, kranthi kranthi...@gmail.com wrote:

 How can i change the temporary upload directory?
 var_dump(ini_get('upload_tmp_dir'));  gives me (and that is set in
 php.ini)
 string '/var/www/cgi-bin' (length=16)

 but
 var_dump($_FILES) gives
 me
 'tmp_name' = string '/tmp/phpbSZ6WP' (length=14)

 var_dump(file_exists($_FILES['file']['tmp_name']));  gives me  (/tmp
 has permissions drwxrwxrwt and i never used file_move_upload or any
 similar functions)
 boolean false

 am I missing something here?
 Kranthi.

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




Re: [PHP] Upload dir

2009-12-10 Thread kranthi
i doubt i can use ini_set in this scenario

http://us3.php.net/manual/en/ini.core.php#ini.upload-tmp-dir

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



Re: [PHP] Upload file name not file

2009-05-02 Thread Ashley Sheridan
On Fri, 2009-05-01 at 12:38 -0400, Simon wrote:
 On Fri, May 1, 2009 at 9:34 AM, MikeP mpel...@princeton.edu wrote:
  I'm not trying to get the path, just the filename and size, I know how to
  get these, but that would include the file using $_Files, but I dont want to
  upload anything just use the filename and size.(without the path) to insert
  into a DB.
 
 Those are attributes of the file for which you dont have access
 remotely, and the only way to access this information without an
 upload will be using the same hacks as those spywarez use.  A
 technology like flash has read/write access to the remote user's disk
 (to a certain extent), you could use flash to get that information and
 make it send it to you, same thing could be done with ActiveX, etc...
 PHP, JS and HTTP protocol cannot acheive what you want.  (PHP is
 server-side, HTTP is for communication only, JS is client-side but
 locked down very much).
 
 However, at a very low level, it might be possible to achieve this in
 PHP, you could do the upload as if you wanted the whole file.  But the
 first packet received will contain the HTTP Header, and in the header,
 you should have all the info you need (filename and size of data).
 So, low-level speaking, as soon as you receive the first packet and
 have the info, you just need to close the connection (remote end might
 display an error msg saying the upload failed, etc).  PHP supports
 sockets connections, so you could make a basic 'server' that listens
 on another port to perform this.  But i see no way to acheive your
 goal without complications.
 
 Good luck!
 
If you don't set the enctype to multipart/form-data in your form, then
only the filename will be uploaded as part of the form. To get the file
size you would have to allow the file to be uploaded, even if only to
the temporary directory.


Ash
www.ashleysheridan.co.uk


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



[PHP] Upload file name not file

2009-05-01 Thread MikeP
Hello,
Id like to use the popup file system box(input name=userfile type=file 
/) to choose a file name , but I only want to upload the filename , not the 
file. Can I do that?
Thanks
Mike 



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



Re: [PHP] Upload file name not file

2009-05-01 Thread Simon
 Id like to use the popup file system box(input name=userfile type=file
 /) to choose a file name , but I only want to upload the filename , not the
 file. Can I do that?

You're not supposed to have any access to the remote visitor's
computer, and the path to the file being uploaded could contain
sensitive information (ie. like username of windows user).  There are
ways to get the information, even to read information on disk without
the use of a file upload form.  But they are/will be considered like
security threats and are/will be closed down.

IMO, whatever way you find to get this information is meant 1) not to
be portable accross different browsers and 2) to stop working
eventually.  (Of course unless you ask the user to explicitly type the
path in a text input)

What do you need this for?

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



Re: [PHP] Upload file name not file

2009-05-01 Thread MikeP
I'm not trying to get the path, just the filename and size, I know how to 
get these, but that would include the file using $_Files, but I dont want to 
upload anything just use the filename and size.(without the path) to insert 
into a DB.
Simon turne...@gmail.com wrote in message 
news:5f14cf5e0905010629s2253cc3bk2a83dbf8b754c...@mail.gmail.com...
 Id like to use the popup file system box(input name=userfile 
 type=file
 /) to choose a file name , but I only want to upload the filename , not 
 the
 file. Can I do that?

 You're not supposed to have any access to the remote visitor's
 computer, and the path to the file being uploaded could contain
 sensitive information (ie. like username of windows user).  There are
 ways to get the information, even to read information on disk without
 the use of a file upload form.  But they are/will be considered like
 security threats and are/will be closed down.

 IMO, whatever way you find to get this information is meant 1) not to
 be portable accross different browsers and 2) to stop working
 eventually.  (Of course unless you ask the user to explicitly type the
 path in a text input)

 What do you need this for? 



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



Re: [PHP] Upload file name not file

2009-05-01 Thread Simon
On Fri, May 1, 2009 at 9:34 AM, MikeP mpel...@princeton.edu wrote:
 I'm not trying to get the path, just the filename and size, I know how to
 get these, but that would include the file using $_Files, but I dont want to
 upload anything just use the filename and size.(without the path) to insert
 into a DB.

Those are attributes of the file for which you dont have access
remotely, and the only way to access this information without an
upload will be using the same hacks as those spywarez use.  A
technology like flash has read/write access to the remote user's disk
(to a certain extent), you could use flash to get that information and
make it send it to you, same thing could be done with ActiveX, etc...
PHP, JS and HTTP protocol cannot acheive what you want.  (PHP is
server-side, HTTP is for communication only, JS is client-side but
locked down very much).

However, at a very low level, it might be possible to achieve this in
PHP, you could do the upload as if you wanted the whole file.  But the
first packet received will contain the HTTP Header, and in the header,
you should have all the info you need (filename and size of data).
So, low-level speaking, as soon as you receive the first packet and
have the info, you just need to close the connection (remote end might
display an error msg saying the upload failed, etc).  PHP supports
sockets connections, so you could make a basic 'server' that listens
on another port to perform this.  But i see no way to acheive your
goal without complications.

Good luck!

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



[PHP] Upload large 100MB of PDFS to MySQL using PHP, Is my settings ok?

2009-04-02 Thread Louie Miranda
Guys,

I need help on the php and mysql configurations.

I want to be able to upload  100MB to MySQL using PHP.

On PHP, php.ini is as follows:

 max_execution_time = 100; Maximum execution time of each script, in
 seconds
 max_input_time = 100; Maximum amount of time each script may
 spend parsing request data
 memory_limit = 100M  ; Maximum amount of memory a script may consume
 (8MB)
 post_max_size = 100M
 upload_max_filesize = 100M


On MySQL, my.cnf:

 key_buffer = 500M
 max_allowed_packet = 5M
 table_cache = 256
 sort_buffer_size = 1M
 read_buffer_size = 1M
 read_rnd_buffer_size = 4M
 myisam_sort_buffer_size = 128M
 thread_cache_size = 16
 query_cache_size= 64M


The mysql field is set to LONGBLOB

What configurations could I alter more? Because right now, it is just
uploading around 30mb or something? And, no error. Maybe, something is wrong
on the config?
--
Louie Miranda (lmira...@gmail.com)
http://www.louiemiranda.net

Quality Web Hosting - www.axishift.com
Pinoy Web Hosting, Web Hosting Philippines


Re: [PHP] Upload large 100MB of PDFS to MySQL using PHP, Is my settings ok?

2009-04-02 Thread Ian
On 2 Apr 2009 at 15:33, Louie Miranda wrote:

 Guys,
 
 I need help on the php and mysql configurations.
 
 I want to be able to upload  100MB to MySQL using PHP.
 
snip

  max_allowed_packet = 5M

Hi,

This may be the one that's stopping it.  

max_allowed_packet:
http://dev.mysql.com/doc/refman/5.0/en/server-system-
variables.html#sysvar_max_allowed_packet

If the SQL statement you are using goes over 5Mb, MySQL will cut the connection 
with an 
error.  It is strange that you are not seeing an error in your code thought.

Regards

Ian
-- 

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



Re: [PHP] upload progress (was www.soongy.com)

2009-03-03 Thread Ashley Sheridan
On Mon, 2009-03-02 at 18:35 -0800, mike wrote:
 On Mon, Mar 2, 2009 at 3:29 PM, Ashley Sheridan
 a...@ashleysheridan.co.uk wrote:
 
  There are a lot of free FTP Java applets out there, which you could
  easily integrate with a web page and your hosting. You'll have the
  advantage of a familiar interface, multiple uploads, queues, and
  progress bars. Worst case scenario, user has no Java and you have to
  offer a standard upload form.
 
 since it's java, you're getting into Michael's infinite paranoia soapbox... :)
 
 also it requires FTP credentials, or an FTP account, which makes life
 a living hell. firewalls, NATted setups, people finding out it's an
 open FTP, etc.
 
 If you are requiring an applet, I don't see why there is even a
 discussion. Go with Gears, no extra server code or configuration
 necessary.
 
 If you are anti-applet, you'll still need javascript, and depending on
 the file sizes you're dealing with, you'll need to modify the server
 configuration (which is out of a lot of people's control)
 
Whoever said anything about open FTP?


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] upload progress (was www.soongy.com)

2009-03-03 Thread mike
On Tue, Mar 3, 2009 at 12:02 AM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:

 Whoever said anything about open FTP?

how else do you do it?

either it's open/anonymous, or some hardcoded account info. either
way, not very secure, and due to the nature of it, kinda requires the
user to have enough privileges to upload N files of X bytes (you could
put quotas on it, chroot it, blahblah... but still)

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



Re: [PHP] upload progress (was www.soongy.com)

2009-03-03 Thread Ashley Sheridan
On Tue, 2009-03-03 at 02:20 -0800, mike wrote:
 On Tue, Mar 3, 2009 at 12:02 AM, Ashley Sheridan
 a...@ashleysheridan.co.uk wrote:
 
  Whoever said anything about open FTP?
 
 how else do you do it?
 
 either it's open/anonymous, or some hardcoded account info. either
 way, not very secure, and due to the nature of it, kinda requires the
 user to have enough privileges to upload N files of X bytes (you could
 put quotas on it, chroot it, blahblah... but still)
 
The way I've done it for a system at work (it is for staff and clients
only, so I guess that offers some protection) is to use scripts in
conjunction with vsftp. Accounts are managed through an admin web
interface, and each user has their own login credentials. Admittedly,
the username and password are passed as plain text for it to auto
log-in, but afaik, that happens with standard FTP anyway (unencrypted
connections). This is more than likely overkill for this situation, but
I had to resort to it as the system has to handle files over 2GB, and
file upload forms are just not meant to handle that kind of load in the
upstream!


Ash
www.ashleysheridan.co.uk


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



RE: [PHP] upload progress (was www.soongy.com)

2009-03-02 Thread Boyd, Todd M.
 -Original Message-
 From: mike [mailto:mike...@gmail.com]
 Sent: Monday, March 02, 2009 12:17 AM
 To: Gevorg Harutyunyan
 Cc: tedd; German Geek; php-general@lists.php.net
 Subject: Re: [PHP] www.soongy.com
 
 I have a basic demo here. The code is not at it's best, you have to
 hit reload to upload a new file.
 
 http://mikehost.com/~mike/tmp/u/
 
 It does show you though with some javascript trickery and some math
 you can derive estimated time and approximate speed. I did have an
 example of multiple files too (I don't think this one supports that)
 
 At some point I'll publish all the components required and clean it up
 nicely.
 
 I also have an nginx module to complement it that should be available
 soon, to alleviate the need for the PHP processing piece (even though
 it does work like a charm)
 
 
 On Sun, Mar 1, 2009 at 10:05 PM, Gevorg Harutyunyan
 gevorg...@gmail.com wrote:
  Thank you all for your help!
 
  I tried to do without being dependent from flash, but as I see there
 are
  only two ways for this: flash and loading without tracking
 percentage. I
  choose second way :)
 
  On Mon, Mar 2, 2009 at 1:58 AM, mike mike...@gmail.com wrote:
 
  gears will allow you to do that, more or less. i have it going...

Gears will allow you to do a lot of things. So will site-proprietary Firefox 
extensions that go well outside the realm of basic client-server interaction 
via webpages. I was under the impression that Gears requires a local 
installation of their client library in order to work.

I don't think download this new extension so you can upload files to our site 
is going to go over so well.

  On Sun, Mar 1, 2009 at 12:34 PM, tedd tedd.sperl...@gmail.com
 wrote:
   At 12:13 PM -0800 3/1/09, mike wrote:
  
   you can use gears pretty easily to make a seamless multiple file
   upload now. it's all javascript too so you can make it look how
 you
   want, behave how you want, etc. without having to buy/tweak flash
   code.
  
  
   On Sun, Mar 1, 2009 at 12:07 PM, German Geek geek...@gmail.com
 wrote:
  
    Also check this one out: google uses it in gmail:
  
    
  
   http://code.google.com/p/jquery-multifile-
 plugin/downloads/detail?name=multiple-file-upload.zipcan=2q=
  
   Understood, but I don't think either of these do what the OP
 wanted,
   whcih
   was a real time file upload progress bar.


// Todd


Re: [PHP] upload progress (was www.soongy.com)

2009-03-02 Thread mike
On Mon, Mar 2, 2009 at 7:45 AM, Boyd, Todd M. tmbo...@ccis.edu wrote:

 Gears will allow you to do a lot of things. So will site-proprietary Firefox 
 extensions that go well outside the realm of basic client-server interaction 
 via webpages. I was under the impression that Gears requires a local 
 installation of their client library in order to work.

 I don't think download this new extension so you can upload files to our 
 site is going to go over so well.

Of course not, but

a) browsers don't have it built-in, yet (I was working on trying to
make a standard that I could pitch to browser creators)
b) how do you think the flash or java applets got there anyway? :)

Have a standard upload form. Tell people if they want more advanced
multi-file support, progress support, etc, etc, install Gears as well.

To me, Gears should be something just like Flash and Java... and I
think is lighter-weight and allows for extending browser capabilities
across nearly every platform without learning new languages.

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



RE: [PHP] upload progress (was www.soongy.com)

2009-03-02 Thread Boyd, Todd M.
 -Original Message-
 From: mike [mailto:mike...@gmail.com]
 Sent: Monday, March 02, 2009 12:59 PM
 To: Boyd, Todd M.
 Cc: PHP General list
 Subject: Re: [PHP] upload progress (was www.soongy.com)
 
 On Mon, Mar 2, 2009 at 7:45 AM, Boyd, Todd M. tmbo...@ccis.edu wrote:
 
  Gears will allow you to do a lot of things. So will site-proprietary
 Firefox extensions that go well outside the realm of basic client-
 server interaction via webpages. I was under the impression that Gears
 requires a local installation of their client library in order to work.
 
  I don't think download this new extension so you can upload files to
 our site is going to go over so well.
 
 Of course not, but
 
 a) browsers don't have it built-in, yet (I was working on trying to
 make a standard that I could pitch to browser creators)
 b) how do you think the flash or java applets got there anyway? :)
 
 Have a standard upload form. Tell people if they want more advanced
 multi-file support, progress support, etc, etc, install Gears as well.
 
 To me, Gears should be something just like Flash and Java... and I
 think is lighter-weight and allows for extending browser capabilities
 across nearly every platform without learning new languages.

Well it's just Javascript with access to local database storage and a caching 
facility, isn't it? I mean, I know Google threw a bunch of their API libraries 
in there with it (geolocation, for instance), but what little digging I've done 
into the matter has produced what I consider extended Javascript.

Again, I don't know a whole lot about it--I've just looked over the example 
scripts and read an article about its caching capabilities as applied to 
Wikipedia.


// Todd


Re: [PHP] upload progress (was www.soongy.com)

2009-03-02 Thread Michael A. Peters

mike wrote:

On Mon, Mar 2, 2009 at 7:45 AM, Boyd, Todd M. tmbo...@ccis.edu wrote:


Gears will allow you to do a lot of things. So will site-proprietary Firefox 
extensions that go well outside the realm of basic client-server interaction 
via webpages. I was under the impression that Gears requires a local 
installation of their client library in order to work.

I don't think download this new extension so you can upload files to our site 
is going to go over so well.


Of course not, but

a) browsers don't have it built-in, yet (I was working on trying to
make a standard that I could pitch to browser creators)
b) how do you think the flash or java applets got there anyway? :)

Have a standard upload form. Tell people if they want more advanced
multi-file support, progress support, etc, etc, install Gears as well.

To me, Gears should be something just like Flash and Java... and I
think is lighter-weight and allows for extending browser capabilities
across nearly every platform without learning new languages.



I don't like to install firefox extensions, I keep them to a bare 
minimum (more stable that way, less annoyances from updates to some 
extension or another being found ever session, etc) and I don't like 
sites that depend upon flash and java for functionality.


I won't install an extension just to use a specific site, I only install 
an extension if it is something I want (IE noscript - to keep your 
annoying flash from using my browsers resources).


You can do a good multi-file upload progress bar w/ the client only 
needing to allow JavaScript. In the OP's case that may mean the OP has 
to change hosts or use perl to process the upload, but here's the thing 
- if the client doesn't allow JavaScript, the upload still works fine - 
they just don't get a progress bar. You can use the same form - just use 
noscriptfoo/noscript to tell users to be patient and not hit submit 
20 zillion times.


With a flash / java based solution, you have to have different code for 
users who wisely do not allow flash and/or java, which is more work for 
you (you have to test and maintain multiple uploads) and requires the 
user to take specific action depending upon their setup.


// steps off soap box

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



Re: [PHP] upload progress (was www.soongy.com)

2009-03-02 Thread Nitsan Bin-Nun
I have just been wondering for the 20 zillion time why does people always
stick together 20 and zillion? you can't just use zillion times? is
that not enough for you?

On Mon, Mar 2, 2009 at 10:26 PM, Michael A. Peters mpet...@mac.com wrote:

 mike wrote:

 On Mon, Mar 2, 2009 at 7:45 AM, Boyd, Todd M. tmbo...@ccis.edu wrote:

  Gears will allow you to do a lot of things. So will site-proprietary
 Firefox extensions that go well outside the realm of basic client-server
 interaction via webpages. I was under the impression that Gears requires a
 local installation of their client library in order to work.

 I don't think download this new extension so you can upload files to our
 site is going to go over so well.


 Of course not, but

 a) browsers don't have it built-in, yet (I was working on trying to
 make a standard that I could pitch to browser creators)
 b) how do you think the flash or java applets got there anyway? :)

 Have a standard upload form. Tell people if they want more advanced
 multi-file support, progress support, etc, etc, install Gears as well.

 To me, Gears should be something just like Flash and Java... and I
 think is lighter-weight and allows for extending browser capabilities
 across nearly every platform without learning new languages.


 I don't like to install firefox extensions, I keep them to a bare minimum
 (more stable that way, less annoyances from updates to some extension or
 another being found ever session, etc) and I don't like sites that depend
 upon flash and java for functionality.

 I won't install an extension just to use a specific site, I only install an
 extension if it is something I want (IE noscript - to keep your annoying
 flash from using my browsers resources).

 You can do a good multi-file upload progress bar w/ the client only needing
 to allow JavaScript. In the OP's case that may mean the OP has to change
 hosts or use perl to process the upload, but here's the thing - if the
 client doesn't allow JavaScript, the upload still works fine - they just
 don't get a progress bar. You can use the same form - just use
 noscriptfoo/noscript to tell users to be patient and not hit submit 20
 zillion times.

 With a flash / java based solution, you have to have different code for
 users who wisely do not allow flash and/or java, which is more work for you
 (you have to test and maintain multiple uploads) and requires the user to
 take specific action depending upon their setup.

 // steps off soap box


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




Re: [PHP] upload progress (was www.soongy.com)

2009-03-02 Thread Michael A. Peters

Nitsan Bin-Nun wrote:
I have just been wondering for the 20 zillion time why does people 
always stick together 20 and zillion? you can't just use zillion 
times? is that not enough for you?


My server can handle 19 zillion multiple submits.

;)

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



Re: [PHP] upload progress (was www.soongy.com)

2009-03-02 Thread Shawn McKenzie
Nitsan Bin-Nun wrote:
 I have just been wondering for the 20 zillion time why does people always
 stick together 20 and zillion? you can't just use zillion times? is
 that not enough for you?

Actually, instead of 20 zillion I would say 2 bazillion, or .2
gazillion.  Now if I really wanted to impress, I would go for jillions,
bajillions or maybe gajillions.

Umptillion is right out...

-- 
Thanks!
-Shawn
http://www.spidean.com

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



Re: [PHP] upload progress (was www.soongy.com)

2009-03-02 Thread mike
Yes you can do it with only javascript but you'll need server  
components to deal with large files ... Which the OP does not have  
access to. Post and file limits could become an issue.


Not to mention flash and java penetration is huge. I think flash is on  
something like 96% of browsers now...


Just think of how usenet, bittorrent, etc work. They split up larger  
files into smaller chunks and assemble it after. The same idea was in  
my head when I approached this.


On Mar 2, 2009, at 12:26 PM, Michael A. Peters mpet...@mac.com  
wrote:



mike wrote:
On Mon, Mar 2, 2009 at 7:45 AM, Boyd, Todd M. tmbo...@ccis.edu  
wrote:
Gears will allow you to do a lot of things. So will site- 
proprietary Firefox extensions that go well outside the realm of  
basic client-server interaction via webpages. I was under the  
impression that Gears requires a local installation of their  
client library in order to work.


I don't think download this new extension so you can upload files  
to our site is going to go over so well.

Of course not, but
a) browsers don't have it built-in, yet (I was working on trying to
make a standard that I could pitch to browser creators)
b) how do you think the flash or java applets got there anyway? :)
Have a standard upload form. Tell people if they want more advanced
multi-file support, progress support, etc, etc, install Gears as  
well.

To me, Gears should be something just like Flash and Java... and I
think is lighter-weight and allows for extending browser capabilities
across nearly every platform without learning new languages.


I don't like to install firefox extensions, I keep them to a bare  
minimum (more stable that way, less annoyances from updates to some  
extension or another being found ever session, etc) and I don't like  
sites that depend upon flash and java for functionality.


I won't install an extension just to use a specific site, I only  
install an extension if it is something I want (IE noscript - to  
keep your annoying flash from using my browsers resources).


You can do a good multi-file upload progress bar w/ the client only  
needing to allow JavaScript. In the OP's case that may mean the OP  
has to change hosts or use perl to process the upload, but here's  
the thing - if the client doesn't allow JavaScript, the upload still  
works fine - they just don't get a progress bar. You can use the  
same form - just use noscriptfoo/noscript to tell users to be  
patient and not hit submit 20 zillion times.


With a flash / java based solution, you have to have different code  
for users who wisely do not allow flash and/or java, which is more  
work for you (you have to test and maintain multiple uploads) and  
requires the user to take specific action depending upon their setup.


// steps off soap box

--
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] upload progress (was www.soongy.com)

2009-03-02 Thread Michael A. Peters

mike wrote:
Yes you can do it with only javascript but you'll need server components 
to deal with large files ... Which the OP does not have access to. Post 
and file limits could become an issue.


Not to mention flash and java penetration is huge. I think flash is on 
something like 96% of browsers now...


And more and more people are using something like noscript to block it 
because XSS hacks are out of control. It is too easy to publish a 
website and too many web developers only care about their own data, they 
don't care about protecting users from malicious content.


That's why more and more users who have flash installed are not letting 
web sites execute it (or anything).


If you are youtube, it is reasonable to require the user have flash 
installed. Otherwise there's a good chance they won't.


I don't let a site execute flash in my browser unless I'm sure I need it 
to get what I want. Sites that code in flash that don't need to, I'm not 
going to open up myself to possible XSS exploits just because they chose 
to make their site only work when I open up my browser to vulnerabilities.


Many corporate environments are now also mandating that flash and 
javascript be disables as well because of the XSS dangers.


Use Javascript to make life easier on those who have it enabled but if 
things don't work peachy without it, you are doing it wrong.


Use flash for what really genuinely requires flash, and file upload 
isn't one of them.


Once http://people.mozilla.org/~bsterne/content-security-policy/ is 
properly implemented - I intend to only allow sites that set a 
reasonable security policy to execute anything in my browser, and I 
suspect other users will do the same. Then maybe if you have properly 
coded your site to send a content-security-policy header with reasonable 
policies I might let you use flash to upload files, assuming your policy 
specifies the source for the flash must be on your domain, but right now 
there just isn't enough client side security available to properly 
protect the users who allow execution, so educated users are very leery 
of allowing anything to run in their browser.


If I attached somefile.exe and told you to run it, would you?

Web masters who require the user to allow execution are doing just that, 
and users who allow such execution of code they know nothing about are, 
to be blundt, fools and easy targets.


// steps off soap box - permanently for awhile, I'm getting too preachy

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



Re: [PHP] upload progress (was www.soongy.com)

2009-03-02 Thread Ashley Sheridan
On Mon, 2009-03-02 at 15:02 -0800, mike wrote:
 Yes you can do it with only javascript but you'll need server  
 components to deal with large files ... Which the OP does not have  
 access to. Post and file limits could become an issue.
 
 Not to mention flash and java penetration is huge. I think flash is on  
 something like 96% of browsers now...
 
 Just think of how usenet, bittorrent, etc work. They split up larger  
 files into smaller chunks and assemble it after. The same idea was in  
 my head when I approached this.
 
 On Mar 2, 2009, at 12:26 PM, Michael A. Peters mpet...@mac.com  
 wrote:
 
  mike wrote:
  On Mon, Mar 2, 2009 at 7:45 AM, Boyd, Todd M. tmbo...@ccis.edu  
  wrote:
  Gears will allow you to do a lot of things. So will site- 
  proprietary Firefox extensions that go well outside the realm of  
  basic client-server interaction via webpages. I was under the  
  impression that Gears requires a local installation of their  
  client library in order to work.
 
  I don't think download this new extension so you can upload files  
  to our site is going to go over so well.
  Of course not, but
  a) browsers don't have it built-in, yet (I was working on trying to
  make a standard that I could pitch to browser creators)
  b) how do you think the flash or java applets got there anyway? :)
  Have a standard upload form. Tell people if they want more advanced
  multi-file support, progress support, etc, etc, install Gears as  
  well.
  To me, Gears should be something just like Flash and Java... and I
  think is lighter-weight and allows for extending browser capabilities
  across nearly every platform without learning new languages.
 
  I don't like to install firefox extensions, I keep them to a bare  
  minimum (more stable that way, less annoyances from updates to some  
  extension or another being found ever session, etc) and I don't like  
  sites that depend upon flash and java for functionality.
 
  I won't install an extension just to use a specific site, I only  
  install an extension if it is something I want (IE noscript - to  
  keep your annoying flash from using my browsers resources).
 
  You can do a good multi-file upload progress bar w/ the client only  
  needing to allow JavaScript. In the OP's case that may mean the OP  
  has to change hosts or use perl to process the upload, but here's  
  the thing - if the client doesn't allow JavaScript, the upload still  
  works fine - they just don't get a progress bar. You can use the  
  same form - just use noscriptfoo/noscript to tell users to be  
  patient and not hit submit 20 zillion times.
 
  With a flash / java based solution, you have to have different code  
  for users who wisely do not allow flash and/or java, which is more  
  work for you (you have to test and maintain multiple uploads) and  
  requires the user to take specific action depending upon their setup.
 
  // steps off soap box
 
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
There are a lot of free FTP Java applets out there, which you could
easily integrate with a web page and your hosting. You'll have the
advantage of a familiar interface, multiple uploads, queues, and
progress bars. Worst case scenario, user has no Java and you have to
offer a standard upload form.


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] upload progress (was www.soongy.com)

2009-03-02 Thread mike
On Mon, Mar 2, 2009 at 3:29 PM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:

 There are a lot of free FTP Java applets out there, which you could
 easily integrate with a web page and your hosting. You'll have the
 advantage of a familiar interface, multiple uploads, queues, and
 progress bars. Worst case scenario, user has no Java and you have to
 offer a standard upload form.

since it's java, you're getting into Michael's infinite paranoia soapbox... :)

also it requires FTP credentials, or an FTP account, which makes life
a living hell. firewalls, NATted setups, people finding out it's an
open FTP, etc.

If you are requiring an applet, I don't see why there is even a
discussion. Go with Gears, no extra server code or configuration
necessary.

If you are anti-applet, you'll still need javascript, and depending on
the file sizes you're dealing with, you'll need to modify the server
configuration (which is out of a lot of people's control)

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



Re: [PHP] upload progress (was www.soongy.com)

2009-03-02 Thread mike
On Mon, Mar 2, 2009 at 3:25 PM, Michael A. Peters mpet...@mac.com wrote:

 And more and more people are using something like noscript to block it
 because XSS hacks are out of control. It is too easy to publish a website
 and too many web developers only care about their own data, they don't care
 about protecting users from malicious content.

More and more ... yes, a handful a day. The vast majority of users
don't. Just like people going insane about cookie security. It's the
uninformed and paranoid spreading FUD. I have Javascript, Java, Flash
and Gears all enabled on my browsers - I have zero issues. I enjoy the
capabilities that Flash and Gears add too, and nowadays almost every
website relies on Javascript for something.

 That's why more and more users who have flash installed are not letting web
 sites execute it (or anything).

Got some stats/URLs for this?

 If you are youtube, it is reasonable to require the user have flash
 installed. Otherwise there's a good chance they won't.

Interesting. Flash has a 96% or some sort penetration, and it is not
usually based on a per-site basis. Why is youtube the only site
someone would allow Flash on? More and more websites are turning to
rich media, with Flash being the defacto standard. Go to almost any
major website, and if the content itself doesn't have Flash mixed in,
the banner ads and other functionality does.

 I don't let a site execute flash in my browser unless I'm sure I need it to
 get what I want. Sites that code in flash that don't need to, I'm not going
 to open up myself to possible XSS exploits just because they chose to make
 their site only work when I open up my browser to vulnerabilities.

Only the paranoid survive... I also don't drive on days ending with
y because of the chance of an automobile accident.

 Many corporate environments are now also mandating that flash and javascript
 be disables as well because of the XSS dangers.

Funny, I work for a fortune 50 company and Java is mandatory on our
machines due to the intranet applications which require applet
support.

 Use Javascript to make life easier on those who have it enabled but if
 things don't work peachy without it, you are doing it wrong.

Gears is basically extensiosn to Javascript with some security baked
in... so thank you for further reiterating my point.

 Use flash for what really genuinely requires flash, and file upload isn't
 one of them.

Agreed. It's just another applet option. Just like ActiveX or Java.

 If I attached somefile.exe and told you to run it, would you?

 Web masters who require the user to allow execution are doing just that, and
 users who allow such execution of code they know nothing about are, to be
 blundt, fools and easy targets.

Last I checked, Flash applets aren't very insecure. Java is a bit
easier. ActiveX is very easy.

It's all about the installation and the user.

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



[PHP] upload file problem

2008-07-31 Thread Jignesh Thummar
I'm trying to upload the file. It's showing me successfully uploaded.
But it's not able to move from temp directory to my defined directory

my code:

if (is_uploaded_file($_FILES['myfile']['tmp_name'])) {
   move_uploaded_file($_FILES['myfile']['tmp_name'], $myfilename);
   echo File . $_FILES['myfile']['name'] . uploaded successfully.\n;
} else {
 echo File uploading error;
}

Thanks in advance.

-Jignesh

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



Re: [PHP] upload file problem

2008-07-31 Thread Eric Butera
On Thu, Jul 31, 2008 at 10:18 AM, Jignesh Thummar
[EMAIL PROTECTED] wrote:
 I'm trying to upload the file. It's showing me successfully uploaded.
 But it's not able to move from temp directory to my defined directory

 my code:

 if (is_uploaded_file($_FILES['myfile']['tmp_name'])) {
   move_uploaded_file($_FILES['myfile']['tmp_name'], $myfilename);
   echo File . $_FILES['myfile']['name'] . uploaded successfully.\n;
 } else {
  echo File uploading error;
 }

 Thanks in advance.

 -Jignesh

Is the directory you're moving to writable by your web server?  If you
don't know, try making a separate script that tries
var_dump(is_writable('/path/to/uploads'));

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



Re: [PHP] upload file problem

2008-07-31 Thread Jignesh Thummar
it's writable.

On Thu, Jul 31, 2008 at 3:37 PM, Eric Butera [EMAIL PROTECTED] wrote:
 On Thu, Jul 31, 2008 at 10:18 AM, Jignesh Thummar
 [EMAIL PROTECTED] wrote:
 I'm trying to upload the file. It's showing me successfully uploaded.
 But it's not able to move from temp directory to my defined directory

 my code:

 if (is_uploaded_file($_FILES['myfile']['tmp_name'])) {
   move_uploaded_file($_FILES['myfile']['tmp_name'], $myfilename);
   echo File . $_FILES['myfile']['name'] . uploaded successfully.\n;
 } else {
  echo File uploading error;
 }

 Thanks in advance.

 -Jignesh

 Is the directory you're moving to writable by your web server?  If you
 don't know, try making a separate script that tries
 var_dump(is_writable('/path/to/uploads'));


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



Re: [PHP] upload file problem

2008-07-31 Thread Micah Gersten
Maybe check the return value of the function:
http://us3.php.net/manual/en/function.move-uploaded-file.php

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Jignesh Thummar wrote:
 I'm trying to upload the file. It's showing me successfully uploaded.
 But it's not able to move from temp directory to my defined directory

 my code:

 if (is_uploaded_file($_FILES['myfile']['tmp_name'])) {
move_uploaded_file($_FILES['myfile']['tmp_name'], $myfilename);
echo File . $_FILES['myfile']['name'] . uploaded successfully.\n;
 } else {
  echo File uploading error;
 }

 Thanks in advance.

 -Jignesh

   

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



Re: [PHP] upload file problem

2008-07-31 Thread Daniel Brown
On Thu, Jul 31, 2008 at 10:18 AM, Jignesh Thummar
[EMAIL PROTECTED] wrote:
 I'm trying to upload the file. It's showing me successfully uploaded.
 But it's not able to move from temp directory to my defined directory

 my code:

 if (is_uploaded_file($_FILES['myfile']['tmp_name'])) {
   move_uploaded_file($_FILES['myfile']['tmp_name'], $myfilename);
   echo File . $_FILES['myfile']['name'] . uploaded successfully.\n;
 } else {
  echo File uploading error;
 }

If it is passing the if(is_uploaded_file()) condition, echo out
$myfilename and make sure it's valid to use as a path/filename.

-- 
/Daniel P. Brown
Better prices on dedicated servers:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Dedicated servers, VPS, and hosting from $2.50/mo.

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



Re: [PHP] upload file problem

2008-07-31 Thread brian

Jignesh Thummar wrote:

I'm trying to upload the file. It's showing me successfully uploaded.
But it's not able to move from temp directory to my defined directory

my code:

if (is_uploaded_file($_FILES['myfile']['tmp_name'])) {
   move_uploaded_file($_FILES['myfile']['tmp_name'], $myfilename);
   echo File . $_FILES['myfile']['name'] . uploaded successfully.\n;
} else {
 echo File uploading error;
}



What does $myfilename resolve to? It should include the complete path 
from server root (not DOCUMENT_ROOT).


Try:

echo File uploading error: ${myfilename};

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



Re: [PHP] upload file problem

2008-07-31 Thread Jignesh Thummar
Thanks.. It's fixed...

- Jignesh

On Thu, Jul 31, 2008 at 6:05 PM, brian [EMAIL PROTECTED] wrote:
 Jignesh Thummar wrote:

 I'm trying to upload the file. It's showing me successfully uploaded.
 But it's not able to move from temp directory to my defined directory

 my code:

 if (is_uploaded_file($_FILES['myfile']['tmp_name'])) {
   move_uploaded_file($_FILES['myfile']['tmp_name'], $myfilename);
   echo File . $_FILES['myfile']['name'] . uploaded successfully.\n;
 } else {
  echo File uploading error;
 }


 What does $myfilename resolve to? It should include the complete path from
 server root (not DOCUMENT_ROOT).

 Try:

 echo File uploading error: ${myfilename};

 --
 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] Re: [PHP-DB] php upload questions --move_uploaded_file

2008-06-26 Thread Daniel Brown
   Hai,

   I'm forwarding this email over to the PHP-General list, since it's
not database-related.  If you're not already subscribed there, please
subscribe and I'm sure you'll get some responses.

   ORIGINAL MESSAGE FOLLOWS:



On Thu, Jun 26, 2008 at 6:21 AM, Liu, Hai Tao (Taylor)
[EMAIL PROTECTED] wrote:
 Hi all:

 I meet a very strange problem about php upload.
 Usually, we use move_uploaded_file to  upload, but it could not work in
 flex use php to upload.
 Same Php upload code can work in html page, and move_uploaded_file
 function  will return 1;
 But it  could not work in flex, and move_uploaded_file  function  return
 nothing.
 I wonder if PHP have some restriction?  Has anyone meet such problems?
 Thank you very much!


 Flex upload code:
  file = new FileReference();
  ..
  var request:URLRequest = new
 URLRequest(http://www.a.com/upload.php;);
 ...
  file.upload(request);

 Php code:

 ?php

$uploadFolder = $_SERVER['DOCUMENT_ROOT']./previews/order/; //
 upload folder
$destFileName = $_REQUEST['fileName'];
$dest = $uploadFolder.$destFileName;

if (sizeof($_FILES)==0) {
echo no file;
}

$f=array_pop($_FILES);
echo $f['tmp_name'].br  ;
   error_log($uploadFolder.\r\n, 3,
 $_SERVER['DOCUMENT_ROOT']./FileService.log);
error_log($f['tmp_name'].'::'.$f['name'].\r\n, 3,
 $_SERVER['DOCUMENT_ROOT']./FileService.log);
error_log((is_uploaded_file($f['tmp_name'])?true:false).\r\n,
 3, $_SERVER['DOCUMENT_ROOT']./FileService.log);  return
 true here!

echo $dest;
   $r = move_uploaded_file($f['tmp_name'],$dest);

   error_log(uploadresult--.$r.--\r\n, 3,
 $_SERVER['DOCUMENT_ROOT']./FileService.log);
  chmod($dest,0777);
 ?
 Thank!
 Luna

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





-- 
/Daniel P. Brown
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.

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



[PHP] upload issue

2008-02-17 Thread nihilism machine
any idea why this fails?this is the error: Sorry, there was a problem  
uploading your file


?php

require_once(classes/db.class.php);

$target = ;
$fileName = basename( $_FILES['uploaded']['name']);
$extension = strtolower(strrchr($fileName,.));
$DB = new DB();
$insertID = $DB-insert_sql(INSERT INTO CMS_Media (File_Name) VALUES  
(''));

$target = media/ . $insertID . $extension;
//echo $target;
if (move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) {
// Error
echo File was uploaded!;
} else {
echo Sorry, there was a problem uploading your file.;
}

chmod($target, 0755);

header(Location: crop.php?imageName=$newFileName);

?




---
Edward H. Hotchkiss
Chief Technical Officer
Durgle, INC
[EMAIL PROTECTED]
http://www.durgle.com
---



Re: [PHP] upload issue

2008-02-17 Thread Børge Holen
On Sunday 17 February 2008 19:22:03 nihilism machine wrote:
 any idea why this fails?this is the error: Sorry, there was a problem
 uploading your file

 ?php

 require_once(classes/db.class.php);

 $target = ;
 $fileName = basename( $_FILES['uploaded']['name']);
 $extension = strtolower(strrchr($fileName,.));
 $DB = new DB();
 $insertID = $DB-insert_sql(INSERT INTO CMS_Media (File_Name) VALUES
 (''));
 $target = media/ . $insertID . $extension;
 //echo $target;
 if (move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) {
   // Error
   echo File was uploaded!;
 } else {
   echo Sorry, there was a problem uploading your file.;
 }

 chmod($target, 0755);

 header(Location: crop.php?imageName=$newFileName);

 ?


This looks weird. is this actually anything: $_FILES['uploaded']['tmp_name']. 
I always used $_FILES['tmp_name'], $_FILES['name'] and such




 ---
 Edward H. Hotchkiss
 Chief Technical Officer
 Durgle, INC
 [EMAIL PROTECTED]
 http://www.durgle.com
 ---



-- 
---
Børge Holen
http://www.arivene.net

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



Re: [PHP] upload issue

2008-02-17 Thread Chris

nihilism machine wrote:
any idea why this fails?this is the error: Sorry, there was a problem 
uploading your file


It can't move the file to the $target location, or maybe the file wasn't 
uploaded properly in the first place.


What's in $_FILES['uploaded']['error'] ?

http://www.php.net/manual/en/features.file-upload.errors.php


if (move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) {
// Error
echo File was uploaded!;
} else {
echo Sorry, there was a problem uploading your file.;
}

chmod($target, 0755);


Files do not need to be 0755, they should be 0644 unless you want them 
to actually run something (eg they are a shell script or perl script 
that you'd run from the cmd line).


--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] upload issue

2008-02-17 Thread Chris

Børge Holen wrote:

On Sunday 17 February 2008 19:22:03 nihilism machine wrote:

any idea why this fails?this is the error: Sorry, there was a problem
uploading your file

?php

require_once(classes/db.class.php);

$target = ;
$fileName = basename( $_FILES['uploaded']['name']);
$extension = strtolower(strrchr($fileName,.));
$DB = new DB();
$insertID = $DB-insert_sql(INSERT INTO CMS_Media (File_Name) VALUES
(''));
$target = media/ . $insertID . $extension;
//echo $target;
if (move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) {
// Error
echo File was uploaded!;
} else {
echo Sorry, there was a problem uploading your file.;
}

chmod($target, 0755);

header(Location: crop.php?imageName=$newFileName);

?



This looks weird. is this actually anything: $_FILES['uploaded']['tmp_name']. 
I always used $_FILES['tmp_name'], $_FILES['name'] and such


According to php docs it's always a multi-dimensional array:
http://www.php.net/manual/en/features.file-upload.php

The 'uploaded' is what you call the file input in your form.

--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] upload issue

2008-02-17 Thread Børge Holen
On Monday 18 February 2008 00:59:31 Chris wrote:
 Børge Holen wrote:
  On Sunday 17 February 2008 19:22:03 nihilism machine wrote:
  any idea why this fails?this is the error: Sorry, there was a problem
  uploading your file
 
  ?php
 
  require_once(classes/db.class.php);
 
  $target = ;
  $fileName = basename( $_FILES['uploaded']['name']);
  $extension = strtolower(strrchr($fileName,.));
  $DB = new DB();
  $insertID = $DB-insert_sql(INSERT INTO CMS_Media (File_Name) VALUES
  (''));
  $target = media/ . $insertID . $extension;
  //echo $target;
  if (move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) {
 // Error
 echo File was uploaded!;
  } else {
 echo Sorry, there was a problem uploading your file.;
  }
 
  chmod($target, 0755);
 
  header(Location: crop.php?imageName=$newFileName);
 
  ?
 
  This looks weird. is this actually anything:
  $_FILES['uploaded']['tmp_name']. I always used $_FILES['tmp_name'],
  $_FILES['name'] and such

 According to php docs it's always a multi-dimensional array:
 http://www.php.net/manual/en/features.file-upload.php

 The 'uploaded' is what you call the file input in your form.

oh well, as long as it works for me, thanks for the info


 --
 Postgresql  php tutorials
 http://www.designmagick.com/



-- 
---
Børge Holen
http://www.arivene.net

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



[PHP] upload issue

2008-01-23 Thread nihilism machine

i am using this code on my form page:

form action=uploadAd2.php enctype=multipart/form-data  
method=post name=adForm id=adForm
input type=hidden name=donorID value=?php echo $_GET['ID']; ? 
 /

input type=hidden name=MAX_FILE_SIZE value=30 /
input type=file name=upload1 /
input type=image src=admin/images/next.png name=Submit  
alt=Submit Form /




my upload code is below:


$uploaddir = 'admin/advertisements/';
$uploadfileTmp = basename($_FILES['upload1']['name']);
$uploadfile = $uploaddir . basename($_FILES['upload1']['name']);
if (move_uploaded_file($_FILES['upload1']['tmp_name'], $uploadfile)) {
$FileName = $uploadfileTmp;
} else {
echo Error!;
exit();
}





my error is:


Internal Server Error

The server encountered an internal error or misconfiguration and was  
unable to complete your request.


Please contact the server administrator, [EMAIL PROTECTED] and  
inform them of the time the error occurred, and anything you might  
have done that may have caused the error.


More information about this error may be available in the server error  
log.


---


any ideas? i have no access to error.log...

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



Re: [PHP] upload issue

2008-01-23 Thread Richard Lynch
On Wed, January 23, 2008 6:55 pm, nihilism machine wrote:
 i am using this code on my form page:

 form action=uploadAd2.php enctype=multipart/form-data
 method=post name=adForm id=adForm
 input type=hidden name=donorID value=?php echo $_GET['ID']; ?
   /
 input type=hidden name=MAX_FILE_SIZE value=30 /
 input type=file name=upload1 /
 input type=image src=admin/images/next.png name=Submit
 alt=Submit Form /



 my upload code is below:


 $uploaddir = 'admin/advertisements/';
 $uploadfileTmp = basename($_FILES['upload1']['name']);
 $uploadfile = $uploaddir . basename($_FILES['upload1']['name']);
 if (move_uploaded_file($_FILES['upload1']['tmp_name'], $uploadfile)) {
   $FileName = $uploadfileTmp;
 } else {
   echo Error!;
   exit();
 }





 my error is:


 Internal Server Error

 The server encountered an internal error or misconfiguration and was
 unable to complete your request.

 Please contact the server administrator, [EMAIL PROTECTED] and
 inform them of the time the error occurred, and anything you might
 have done that may have caused the error.

 More information about this error may be available in the server error
 log.

Check the error_log of Apache.

It will almost certainly have more info.

You'll have to cause the error again or know the time when it happened
to find the error.

You should also make sure plain simple pages like ?php phpinfo()?
work as expected.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

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



[PHP] upload problem

2008-01-22 Thread nihilism machine

any ideas why this does not work?


class upload {

function upload() {
upload::uploader();
}

function uploader() {
$FileName = basename($_FILES['upload1']['name']);
if (move_uploaded_file($_FILES['upload1']['tmp_name'], 
$FileName)) {
chmod($FileName, 0755);
rename($FileName, admin/advertisements/ . $FileName);
return $FileName;
} else {
return Error!;
}
}
}

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



Re: [PHP] upload problem

2008-01-22 Thread Casey
On Jan 22, 2008, at 5:01 PM, nihilism machine  
[EMAIL PROTECTED] wrote:



any ideas why this does not work?


class upload {

   function upload() {
   upload::uploader();
   }

   function uploader() {
   $FileName = basename($_FILES['upload1']['name']);
   if (move_uploaded_file($_FILES['upload1']['tmp_name'],  
$FileName)) {

   chmod($FileName, 0755);
   rename($FileName, admin/advertisements/ . $FileName);
   return $FileName;
   } else {
   return Error!;
   }
   }
}


Try deleting the upload() function. Then:

$test = new upload();
$filename = test-uploader();

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



Re: [PHP] upload problem

2008-01-22 Thread Daniel Brown
On Jan 22, 2008 8:01 PM, nihilism machine [EMAIL PROTECTED] wrote:
 any ideas why this does not work?


 class upload {

 function upload() {
 upload::uploader();
 }

 function uploader() {
 $FileName = basename($_FILES['upload1']['name']);
 if (move_uploaded_file($_FILES['upload1']['tmp_name'], 
 $FileName)) {
 chmod($FileName, 0755);
 rename($FileName, admin/advertisements/ . 
 $FileName);
 return $FileName;
 } else {
 return Error!;
 }
 }
 }

What do you mean doesn't work?  Does it hit the Error! return,
does it do nothing, does it come up with a build error?  If you're
more specific, you'll get better responses and quicker help.

-- 
/Dan

Daniel P. Brown
Senior Unix Geek and #1 Rated Year's Coolest Guy By Self Since
Nineteen-Seventy-[mumble].

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



Re: [PHP] upload problem

2008-01-22 Thread Chris

nihilism machine wrote:

any ideas why this does not work?


1) the field in the form might not be 'upload1'.
2) the file is too big to upload ( max_upload_size)
3) the /tmp folder might not be writable or full
4) the folder you're trying to write into is not writable (or the drive 
is full)

5) the rename might not work (same reasons as above)
6) the chmod might fail

that'll do for starters :)

add

error_reporting(E_ALL);
and
ini_set('display_errors', true);

in your script and see what's going on.


instead of doing a move-uploaded-file then a rename, combine them:

$destination = 'admin/advertisements/' . 
basename($_FILES['upload1']['name']);


if (move_uploaded_file($src, $destination)) {
...
}
...

--
Postgresql  php tutorials
http://www.designmagick.com/

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



[PHP] upload temp dir in vhost env.

2007-08-26 Thread jekillen

Hello again;

I have a question about  upload temp dir as defined in php.ini;

I have been working on a project that has registered users, each having
a user space portion of the web site file system. I want them to be
able to upload images and such and have the stuff transfered to their
own user spaces. With one up load temp dir designated, how do I
insure that the uploaded files get to the correct destination?
Or, is it possible to designate more than one up load temp dir in
php.ini. (that would be the best solution)
This situation is not a virtual host environment, but one site that
will be using ssl.
I am using Apache on unix based host and am aware that php
assigns a temp name to files that are uploaded, but if different
users are uploading files concurrently, there could be a confusion
as to where each file should be transfered to.
I do not know where else to look for an answer to this question
at present.
Any knowledgeable response appreciated.
Thanks in advance:
Jeff K.

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



Re: [PHP] upload temp dir in vhost env.

2007-08-26 Thread brian

jekillen wrote:

Hello again;

I have a question about  upload temp dir as defined in php.ini;

I have been working on a project that has registered users, each having
a user space portion of the web site file system. I want them to be
able to upload images and such and have the stuff transfered to their
own user spaces. With one up load temp dir designated, how do I
insure that the uploaded files get to the correct destination?
Or, is it possible to designate more than one up load temp dir in
php.ini. (that would be the best solution)
This situation is not a virtual host environment, but one site that
will be using ssl.


No, the best solution is for your application to grab the path to that 
particular user's directory and assign a unique name to the uploaded 
file, then move it from the temp dir:


move_uploaded_file($_FILES['upload_file']['tmp_name'], $upload_path);

where 'upload_file' is the name of your upload form field.

http://www.php.net/manual/en/function.move-uploaded-file.php


I am using Apache on unix based host and am aware that php
assigns a temp name to files that are uploaded, but if different
users are uploading files concurrently, there could be a confusion
as to where each file should be transfered to.


That's unlikely to occur. In fact, i'd be surprised if it were possible 
that PHP would assign a temp name that already existed.


brian

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



Re: [PHP] upload temp dir in vhost env.

2007-08-26 Thread Ludovic André

Hi,

that's not a problem to specify where the uploaded file has to be moved 
after upload.  As you specify for each user a personal directory in the 
system, you just need to use a function like move_uploaded_file() to 
move the uploaded file to this directory.  Each uploaded file goes to, 
let's say, /tmp (the directory specified in your php config), and 
inherits from a unique filename.  This filename is contained in the 
$_FILES array available in the script which handles the upload. So if 
you have a form containing a file upload field called file, you can 
retrieve the filename of the newly uploaded file using: 
$_FILES['file']['tmp_name'] (if the upload went successfully).

You can then simply use:
move_uploaded_file( $_FILES['file']['tmp_name'], 
'/path/to/user/personal/dir');


This will work even if multiple users are uploading a file at the same 
time, as the $_FILES array will contain the info related to a single user.


I hope I've been clear enough...

Ludo

Hello again;

I have a question about  upload temp dir as defined in php.ini;

I have been working on a project that has registered users, each having
a user space portion of the web site file system. I want them to be
able to upload images and such and have the stuff transfered to their
own user spaces. With one up load temp dir designated, how do I
insure that the uploaded files get to the correct destination?
Or, is it possible to designate more than one up load temp dir in
php.ini. (that would be the best solution)
This situation is not a virtual host environment, but one site that
will be using ssl.
I am using Apache on unix based host and am aware that php
assigns a temp name to files that are uploaded, but if different
users are uploading files concurrently, there could be a confusion
as to where each file should be transfered to.
I do not know where else to look for an answer to this question
at present.
Any knowledgeable response appreciated.
Thanks in advance:
Jeff K.



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



Re: [PHP] upload temp dir in vhost env.

2007-08-26 Thread Richard Lynch
On Sun, August 26, 2007 10:34 am, jekillen wrote:
 I have been working on a project that has registered users, each
 having
 a user space portion of the web site file system. I want them to be
 able to upload images and such and have the stuff transfered to their
 own user spaces. With one up load temp dir designated, how do I
 insure that the uploaded files get to the correct destination?

http://php.net/move_uploaded_file

And, BEFORE you move it, you should Validate the uploaded file as many
ways as practical for your web application.

 I am using Apache on unix based host and am aware that php
 assigns a temp name to files that are uploaded, but if different
 users are uploading files concurrently, there could be a confusion
 as to where each file should be transfered to.

The user uploading the file is probably logged in, and you probably
have some kind of user_id or Profile and can decide where to move the
file based on that user's identity.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] upload temp dir in vhost env.

2007-08-26 Thread jekillen


On Aug 26, 2007, at 9:15 AM, brian wrote:


jekillen wrote:

Hello again;
I have a question about  upload temp dir as defined in php.ini;
I have been working on a project that has registered users, each 
having

a user space portion of the web site file system. I want them to be
able to upload images and such and have the stuff transfered to their
own user spaces. With one up load temp dir designated, how do I
insure that the uploaded files get to the correct destination?
Or, is it possible to designate more than one up load temp dir in
php.ini. (that would be the best solution)
This situation is not a virtual host environment, but one site that
will be using ssl.


No, the best solution is for your application to grab the path to that 
particular user's directory and assign a unique name to the uploaded 
file, then move it from the temp dir:


move_uploaded_file($_FILES['upload_file']['tmp_name'], $upload_path);

where 'upload_file' is the name of your upload form field.

http://www.php.net/manual/en/function.move-uploaded-file.php


I am using Apache on unix based host and am aware that php
assigns a temp name to files that are uploaded, but if different
users are uploading files concurrently, there could be a confusion
as to where each file should be transfered to.


That's unlikely to occur. In fact, i'd be surprised if it were 
possible that PHP would assign a temp name that already existed.


brian



Thanks thats all I need to know.
Jeff K

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



Re: [PHP] upload temp dir in vhost env.

2007-08-26 Thread jekillen


On Aug 26, 2007, at 2:56 PM, Richard Lynch wrote:


On Sun, August 26, 2007 10:34 am, jekillen wrote:

I have been working on a project that has registered users, each
having
a user space portion of the web site file system. I want them to be
able to upload images and such and have the stuff transfered to their
own user spaces. With one up load temp dir designated, how do I
insure that the uploaded files get to the correct destination?


http://php.net/move_uploaded_file

And, BEFORE you move it, you should Validate the uploaded file as many
ways as practical for your web application.


Yes, I agree, I want to completely decontaminate all uploaded files but 
I

am not sure of a system that will do that.
like embedding scripts in image files, binary files, encrypted images
(I forgot the term for that, stegonography or something), shell
escape chars, incompatible files, viruses, erroneous mime or file types,
you name it, I want to check it out before it is a problem.
JK



I am using Apache on unix based host and am aware that php
assigns a temp name to files that are uploaded, but if different
users are uploading files concurrently, there could be a confusion
as to where each file should be transfered to.


The user uploading the file is probably logged in, and you probably
have some kind of user_id or Profile and can decide where to move the
file based on that user's identity.


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



Re: [PHP] Upload and resize file

2007-08-23 Thread Craige Leeder
While I'm not 100% sure, I'd say something's wrong with this line:

system(pnmscale -xy 250 200 $tmpimg | cjpeg -smoo 10 -qual 50
$imgfile);

I would say that Linux is not writing the output to the location
stored in $imgfile, and thus there is no file there to delete.
However, I can not really be sure. Can someone support or deny this
claim?

- Craige

On 8/22/07, Beauford [EMAIL PROTECTED] wrote:
 I downloaded this 'upload and resize image' script, and since I have no idea
 what I am looking at as this is something I have never done, could someone
 have a look and see what the problem might be.  I've been searching around
 but haven't come across anything that makes any sense yet.

 When a picture needs to be resized I am getting the following error. If it
 is the same size or under I don't get this error.

 Warning: unlink() [function.unlink]: No such file or directory in
 /usr/local/apache/htdocs/website/upload.php on line 92

 The full code is below.

 Thanks

 --

 html

 head
 titleweb.blazonry : PHP : Upload and Resize an Image/title

 ?php

 if ($_SERVER['REQUEST_METHOD'] == POST)
 {

 /* SUBMITTED INFORMATION - use what you need
  * temporary filename (pointer): $imgfile
  * original filename   : $imgfile_name
  * size of uploaded file   : $imgfile_size
  * mime-type of uploaded file  : $imgfile_type
  */

  /*== upload directory where the file will be stored
   relative to where script is run ==*/

 $uploaddir = images;


 /*== get file extension (fn at bottom of script) ==*/
 /*== checks to see if image file, if not do not allow upload ==*/
 $pext = getFileExtension($imgfile_name);
 $pext = strtolower($pext);
 if (($pext != jpg)   ($pext != jpeg))
 {
 print h1ERROR/h1Image Extension Unknown.br;
 print pPlease upload only a JPEG image with the extension .jpg or
 .jpeg ONLYbrbr;
 print The file you uploaded had the following extension:
 $pext/p\n;

 /*== delete uploaded file ==*/
 unlink($imgfile);
 exit();
 }


 //-- RE-SIZING UPLOADED IMAGE

 /*== only resize if the image is larger than 250 x 200 ==*/
 $imgsize = GetImageSize($imgfile);

 /*== check size  0=width, 1=height ==*/
 if (($imgsize[0]  250) || ($imgsize[1]  200))
 {
 /*== temp image file -- use tempnam() to generate the temp
  file name. This is done so if multiple people access the
 script at once they won't ruin each other's temp file ==*/
 $tmpimg = tempnam(/tmp, MKUP);

 /*== RESIZE PROCESS
  1. decompress jpeg image to pnm file (a raw image type)
  2. scale pnm image
  3. compress pnm file to jpeg image
 ==*/

 /*== Step 1: djpeg decompresses jpeg to pnm ==*/
 system(djpeg $imgfile $tmpimg);


 /*== Steps 23: scale image using pnmscale and then
  pipe into cjpeg to output jpeg file ==*/
 system(pnmscale -xy 250 200 $tmpimg | cjpeg -smoo 10 -qual 50
 $imgfile);

 /*== remove temp image ==*/
 unlink($tmpimg);

 }

 /*== setup final file location and name ==*/
 /*== change spaces to underscores in filename  ==*/
 $final_filename = str_replace( , _, $imgfile_name);
 $newfile = $uploaddir . /$final_filename;

 /*== do extra security check to prevent malicious abuse==*/
 if (is_uploaded_file($imgfile))
 {

/*== move file to proper directory ==*/
if (!copy($imgfile,$newfile))
{
   /*== if an error occurs the file could not
be written, read or possibly does not exist ==*/
   print Error Uploading File.;
   exit();
}
  }

 /*== delete the temporary uploaded file ==*/
unlink($imgfile);


 print(img src=\images\\$final_filename\);

 /*== DO WHATEVER ELSE YOU WANT
  SUCH AS INSERT DATA INTO A DATABASE  ==*/

 }
 ?


 /head
 body bgcolor=#FF

 h2Upload and Resize an Image/h2

 form action=?php echo $_SERVER['PHP_SELF']; ? method=POST
 enctype=multipart/form-data
 input type=hidden name=MAX_FILE_SIZE value=5

 pUpload Image: input type=file name=imgfilebr
 font size=1Click browse to upload a local file/fontbr
 br
 input type=submit value=Upload Image
 /form

 /body
 /html

 ?php
 /*== FUNCTIONS ==*/

 function getFileExtension($str) {

 $i = strrpos($str,.);
 if (!$i) { return ; }

 $l = strlen($str) - $i;
 $ext = substr($str,$i+1,$l);

 return $ext;

 }
 ?

 --
 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] Upload and resize file

2007-08-23 Thread brian

Beauford wrote:

I downloaded this 'upload and resize image' script, and since I have no idea
what I am looking at as this is something I have never done, could someone
have a look and see what the problem might be.  I've been searching around
but haven't come across anything that makes any sense yet.

When a picture needs to be resized I am getting the following error. If it
is the same size or under I don't get this error.

Warning: unlink() [function.unlink]: No such file or directory in
/usr/local/apache/htdocs/website/upload.php on line 92



I see at least 3 places where unlink() is called. Which one is at line 
92? Knowing that will go along way toward understanding where the script 
has gotten to and what else might be going wrong.


You should place some print statements in the script just before each 
unlink() call. Something like:


print 'first one';
print $tmpimg';
unlink($tmpimg);

...

print 'second one';
print $tmpimg';
unlink($tmpimg);

etc.

This way you'll be able to at least see what is in the var $tmpimg.

brian

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



Re: [PHP] Upload and resize file

2007-08-23 Thread Børge Holen
On Thursday 23 August 2007 03:41, Beauford wrote:
 I downloaded this 'upload and resize image' script, and since I have no
 idea what I am looking at as this is something I have never done, could
 someone have a look and see what the problem might be.  I've been searching
 around but haven't come across anything that makes any sense yet.

 When a picture needs to be resized I am getting the following error. If it
 is the same size or under I don't get this error.

 Warning: unlink() [function.unlink]: No such file or directory in
 /usr/local/apache/htdocs/website/upload.php on line 92

This full code of yours should be no more than 7 lines. However, delete line 
92, it's not needed to make the script actually upload stuff. 
You should have a file like php12312 file name or similar at the default 
upload path defined in php.ini. This file is the $_file['tmp_name'] within 
the $files array, so while at it; don't make use of a $formname for 
everything. 
If you make use of the $_files['array'] stuff the code would be so much more 
manageable within the linux os.

If the temp file does not occur; you got the netpbm and djpeg installed?

Not sure about making this sort of things work under a windows system, but on 
linux its a sundaysprawl


 The full code is below.

 Thanks

 --

 html

 head
 titleweb.blazonry : PHP : Upload and Resize an Image/title

 ?php

 if ($_SERVER['REQUEST_METHOD'] == POST)
 {

 /* SUBMITTED INFORMATION - use what you need
  * temporary filename (pointer): $imgfile
  * original filename   : $imgfile_name
  * size of uploaded file   : $imgfile_size
  * mime-type of uploaded file  : $imgfile_type
  */

  /*== upload directory where the file will be stored
   relative to where script is run ==*/

 $uploaddir = images;


 /*== get file extension (fn at bottom of script) ==*/
 /*== checks to see if image file, if not do not allow upload ==*/
 $pext = getFileExtension($imgfile_name);
 $pext = strtolower($pext);
 if (($pext != jpg)   ($pext != jpeg))
 {
 print h1ERROR/h1Image Extension Unknown.br;
 print pPlease upload only a JPEG image with the extension .jpg
 or .jpeg ONLYbrbr;
 print The file you uploaded had the following extension:
 $pext/p\n;

 /*== delete uploaded file ==*/
 unlink($imgfile);
 exit();
 }


 //-- RE-SIZING UPLOADED IMAGE

 /*== only resize if the image is larger than 250 x 200 ==*/
 $imgsize = GetImageSize($imgfile);

 /*== check size  0=width, 1=height ==*/
 if (($imgsize[0]  250) || ($imgsize[1]  200))
 {
 /*== temp image file -- use tempnam() to generate the temp
  file name. This is done so if multiple people access the
 script at once they won't ruin each other's temp file ==*/
 $tmpimg = tempnam(/tmp, MKUP);

 /*== RESIZE PROCESS
  1. decompress jpeg image to pnm file (a raw image type)
  2. scale pnm image
  3. compress pnm file to jpeg image
 ==*/

 /*== Step 1: djpeg decompresses jpeg to pnm ==*/
 system(djpeg $imgfile $tmpimg);


 /*== Steps 23: scale image using pnmscale and then
  pipe into cjpeg to output jpeg file ==*/
 system(pnmscale -xy 250 200 $tmpimg | cjpeg -smoo 10 -qual 50

 $imgfile);

 /*== remove temp image ==*/
 unlink($tmpimg);

 }

 /*== setup final file location and name ==*/
 /*== change spaces to underscores in filename  ==*/
 $final_filename = str_replace( , _, $imgfile_name);
 $newfile = $uploaddir . /$final_filename;

 /*== do extra security check to prevent malicious abuse==*/
 if (is_uploaded_file($imgfile))
 {

/*== move file to proper directory ==*/
if (!copy($imgfile,$newfile))
{
   /*== if an error occurs the file could not
be written, read or possibly does not exist ==*/
   print Error Uploading File.;
   exit();
}
  }

 /*== delete the temporary uploaded file ==*/
unlink($imgfile);


 print(img src=\images\\$final_filename\);

 /*== DO WHATEVER ELSE YOU WANT
  SUCH AS INSERT DATA INTO A DATABASE  ==*/

 }
 ?


 /head
 body bgcolor=#FF

 h2Upload and Resize an Image/h2

 form action=?php echo $_SERVER['PHP_SELF']; ? method=POST
 enctype=multipart/form-data
 input type=hidden name=MAX_FILE_SIZE value=5

 pUpload Image: input type=file name=imgfilebr
 font size=1Click browse to upload a local file/fontbr
 br
 input type=submit value=Upload Image
 /form

 /body
 /html

 ?php
 /*== FUNCTIONS ==*/

 function getFileExtension($str) {

 $i = strrpos($str,.);
 if (!$i) { return ; }

 $l = strlen($str) - $i;
 $ext = substr($str,$i+1,$l);

 return $ext

[PHP] Upload and resize file

2007-08-22 Thread Beauford
I downloaded this 'upload and resize image' script, and since I have no idea
what I am looking at as this is something I have never done, could someone
have a look and see what the problem might be.  I've been searching around
but haven't come across anything that makes any sense yet.

When a picture needs to be resized I am getting the following error. If it
is the same size or under I don't get this error.

Warning: unlink() [function.unlink]: No such file or directory in
/usr/local/apache/htdocs/website/upload.php on line 92

The full code is below.

Thanks

--

html

head
titleweb.blazonry : PHP : Upload and Resize an Image/title

?php

if ($_SERVER['REQUEST_METHOD'] == POST)
{

/* SUBMITTED INFORMATION - use what you need
 * temporary filename (pointer): $imgfile
 * original filename   : $imgfile_name
 * size of uploaded file   : $imgfile_size
 * mime-type of uploaded file  : $imgfile_type
 */

 /*== upload directory where the file will be stored 
  relative to where script is run ==*/

$uploaddir = images;


/*== get file extension (fn at bottom of script) ==*/
/*== checks to see if image file, if not do not allow upload ==*/
$pext = getFileExtension($imgfile_name);
$pext = strtolower($pext);
if (($pext != jpg)   ($pext != jpeg))
{
print h1ERROR/h1Image Extension Unknown.br;
print pPlease upload only a JPEG image with the extension .jpg or
.jpeg ONLYbrbr;
print The file you uploaded had the following extension:
$pext/p\n;

/*== delete uploaded file ==*/
unlink($imgfile);
exit();
}


//-- RE-SIZING UPLOADED IMAGE

/*== only resize if the image is larger than 250 x 200 ==*/
$imgsize = GetImageSize($imgfile);

/*== check size  0=width, 1=height ==*/
if (($imgsize[0]  250) || ($imgsize[1]  200)) 
{
/*== temp image file -- use tempnam() to generate the temp
 file name. This is done so if multiple people access the 
script at once they won't ruin each other's temp file ==*/
$tmpimg = tempnam(/tmp, MKUP);

/*== RESIZE PROCESS
 1. decompress jpeg image to pnm file (a raw image type) 
 2. scale pnm image
 3. compress pnm file to jpeg image
==*/

/*== Step 1: djpeg decompresses jpeg to pnm ==*/
system(djpeg $imgfile $tmpimg);


/*== Steps 23: scale image using pnmscale and then
 pipe into cjpeg to output jpeg file ==*/
system(pnmscale -xy 250 200 $tmpimg | cjpeg -smoo 10 -qual 50
$imgfile);

/*== remove temp image ==*/
unlink($tmpimg);

}

/*== setup final file location and name ==*/
/*== change spaces to underscores in filename  ==*/
$final_filename = str_replace( , _, $imgfile_name);
$newfile = $uploaddir . /$final_filename;

/*== do extra security check to prevent malicious abuse==*/
if (is_uploaded_file($imgfile))
{

   /*== move file to proper directory ==*/
   if (!copy($imgfile,$newfile)) 
   {
  /*== if an error occurs the file could not
   be written, read or possibly does not exist ==*/
  print Error Uploading File.;
  exit();
   }
 }

/*== delete the temporary uploaded file ==*/
   unlink($imgfile);


print(img src=\images\\$final_filename\);

/*== DO WHATEVER ELSE YOU WANT
 SUCH AS INSERT DATA INTO A DATABASE  ==*/

}
?


/head
body bgcolor=#FF

h2Upload and Resize an Image/h2

form action=?php echo $_SERVER['PHP_SELF']; ? method=POST
enctype=multipart/form-data
input type=hidden name=MAX_FILE_SIZE value=5

pUpload Image: input type=file name=imgfilebr
font size=1Click browse to upload a local file/fontbr
br
input type=submit value=Upload Image
/form

/body
/html

?php
/*== FUNCTIONS ==*/

function getFileExtension($str) {

$i = strrpos($str,.);
if (!$i) { return ; }

$l = strlen($str) - $i;
$ext = substr($str,$i+1,$l);

return $ext;

}
?

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



Re: [PHP] Upload Tracker.

2007-07-17 Thread Tanner Postert

i use a program called upload progress meter, it can be downloaded here:

http://pdoru.from.ro/upload-progress-meter/

I just wrote an ajax function to return the % of the download, and filled a
div on each upload. It depends on how often you poll for the %, but most
likely it won't be a smooth transition from 0-100% it will jump, 0, 12, 28,
38, 52, 71, 88, 92, 100, or something similar.

you will have to phpize the function and install it as a dynamic module, but
it works for me.

hope this helps.

On 7/17/07, Tom Ray [Lists] [EMAIL PROTECTED] wrote:


I'm a little unsure on how to do this but basically when someone uses a
form to upload a file I want to have a popup window come up and so the
process in percentage of the transfer.  Anyone do this before? Is it
possible in PHP or do I need to do it in javascript or a mixture of both?

Any suggestions, ideas, commands or functions to try to use? I would
greatly appreciate it.

Thanks!

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




Re: [PHP] Upload Tracker.

2007-07-17 Thread Paul Novitski

At 7/17/2007 11:46 AM, Tom Ray [Lists] wrote:
I'm a little unsure on how to do this but basically when someone 
uses a form to upload a file I want to have a popup window come up 
and so the process in percentage of the transfer.  Anyone do this 
before? Is it possible in PHP or do I need to do it in javascript or 
a mixture of both?



Upload progress can't be reported using PHP alone, but here's a 
PHP-perl amalgam you can check out:


Mega Upload
http://www.raditha.com/php/progress.php

I haven't used it can can't vouch for it.  When I tried their demo it 
failed but I think for reasons other than the functionality of the 
widget itself.


Paul 


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



[PHP] Upload Tracker.

2007-07-17 Thread Tom Ray [Lists]
I'm a little unsure on how to do this but basically when someone uses a 
form to upload a file I want to have a popup window come up and so the 
process in percentage of the transfer.  Anyone do this before? Is it 
possible in PHP or do I need to do it in javascript or a mixture of both?


Any suggestions, ideas, commands or functions to try to use? I would 
greatly appreciate it.


Thanks!

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



Re: [PHP] Upload Tracker.

2007-07-17 Thread Richard Lynch
On Tue, July 17, 2007 1:46 pm, Tom Ray [Lists] wrote:
 I'm a little unsure on how to do this but basically when someone uses
 a
 form to upload a file I want to have a popup window come up and so the
 process in percentage of the transfer.  Anyone do this before? Is it
 possible in PHP or do I need to do it in javascript or a mixture of
 both?

 Any suggestions, ideas, commands or functions to try to use? I would
 greatly appreciate it.

For this to be a PHP question, you need PHP 5.2 (?) and the new file
upload hook that it supplies.

Otherwise, it's a Javascript/Ajax feature, with PHP being relegated to
not doing much of anything about the progress meter.

Why the BROWSER doesn't provide this feature everybody wants is beyond
my ken...

Surely the browser has some clue how many bytes are uploaded and how
big the file was.

How tricky could it be for Firefox/IE to poke those values into a
couple variables somewhere?

Instead we have a zillion JS hacks by developers generating tons of
traffic back-n-forth to the server to ask it how many bytes it has
received so far...

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Upload a ppt file

2007-05-29 Thread tedd

At 11:07 PM +0200 5/28/07, Tijnema wrote:

On 5/28/07, tedd [EMAIL PROTECTED] wrote:

Hi Gang:

I can upload a text file and an image file via a html form, but I am
having problems uploading a PowerPoint file. Apparently, that's a
different critter.



Duh!

Thanks for the hints -- it was stupid mistake on my part that. 
Sometimes you can get too carried away with trying to make things 
secure.


It works fine now that I let it work.

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



[PHP] Upload a ppt file

2007-05-28 Thread tedd

Hi Gang:

I can upload a text file and an image file via a html form, but I am 
having problems uploading a PowerPoint file. Apparently, that's a 
different critter.


Does any have any references or an example to show me?

Thanks,

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Upload a ppt file

2007-05-28 Thread Tijnema

On 5/28/07, tedd [EMAIL PROTECTED] wrote:

Hi Gang:

I can upload a text file and an image file via a html form, but I am
having problems uploading a PowerPoint file. Apparently, that's a
different critter.

Does any have any references or an example to show me?

Thanks,

Cheers,

tedd


It should work with the same form you used for image  text files, but
make sure you still have enctype set to multipart/form-data.
Also, like Jared said, make sure it isn't limited by any option, this
could be the upload filesize limit, but also memory limit if you were
planning to upload big files :)

Tijnema

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



  1   2   3   4   5   6   >