Re: [PHP-DB] Help/Advice/Suggestions need to Upload 9 images on one submit button.

2003-01-28 Thread Rajesh Fowkar
On Tue, Jan 28, 2003 at 10:44:47PM +0100, Geckodeep wrote:

>Hi Rajesh
>
>
>
>First of all I'd like to thank you for your time.

No hassles.

>
>I got the script working in a way that it feeds my DB table, but I am
>getting this error message: Warning: copy() [function.copy]: Unable to
>access in upload1.php on line 28.
>
>this is what I have in the 28th line :
>if(!copy($_FILES['img_name1']['tmp_name'],
>"./repor_images/$_FILES['img_name1']['tmp_name']")):;

I have never come across the above error message. It looks like copy
function is not allowed on the webserver.

>
>for the moment I am trying it with one field and I am waiting to see if it's
>working, and  I'll had the rest with the Captions to go with the images.
>
>One thing I've forgot to say is though in my database instead of just having
>the name of the image copied from the source (Form Field) I have the whole
>path in the field (  /var/www/12/1/7/-/site/www/php1PWwsF  ), is it normal
>or what?.

In my application, I am uploading the file and than creating a thumbnail
from it and storing both image as well as thumbnail in mysql blob field.

if (!is_uploaded_file($_FILES['Imagefile1']['tmp_name']))
{
$sErrorStr .= "Error Uploading File: '$Imagefile1'." .
  " Either the File Type is Invalid or some connectivity problem, 
Check out" ;
}
else
{
$imgtype = $_FILES['Imagefile1']['type'];
copy($_FILES['Imagefile1']['tmp_name'], './tmp/downloadedfile1.jpg');
$filename = './tmp/downloadedfile1.jpg';
create_thumbnail($filename, $imgtype, $escaped_image, $escaped_thumbnail);
}

>
>I've looked up in the PhpManual for copy() and it says it takes two
>arguments, in that case if I did put it in this way will it work
>copy($img_name1,"/repor_images/$id.$img_name1"); // $img_name1 as the source
>and "repor_images/$id.$img_name1" as the destination,

Should work.

>I also have few questions.
>
>Does that mean I have to have 9 copy functions as above, and just change the
>"img_nameX"?.

Yes. 

>
>Do I have to mention File size and file type for all the file Fields in the
>form or will it be ok just to mention once just above the submit button?.

I feel it is required for all the fields. More experienced souls on the
list, please comment.


Peace

--
Rajesh
:
[ GNU/Linux One Stanza Tip (LOST) ]###
  
Sub : Spell check within MuttLOST #157

If you have the ispell package  (interactive spelling checker)
installed, and maybe your preferred dictionary file iamerican,
ibritish (whatever), press "i" after finishing composition and
prior to sending mail (under mutt) ... 

<[EMAIL PROTECTED]>###
:

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




Re: [PHP-DB] Help/Advice/Suggestions need to Upload 9 images on one submit button.

2003-01-28 Thread Geckodeep
Hi Rajesh



First of all I'd like to thank you for your time.

I got the script working in a way that it feeds my DB table, but I am
getting this error message: Warning: copy() [function.copy]: Unable to
access in upload1.php on line 28.

this is what I have in the 28th line :
if(!copy($_FILES['img_name1']['tmp_name'],
"./repor_images/$_FILES['img_name1']['tmp_name']")):;

for the moment I am trying it with one field and I am waiting to see if it's
working, and  I'll had the rest with the Captions to go with the images.

One thing I've forgot to say is though in my database instead of just having
the name of the image copied from the source (Form Field) I have the whole
path in the field (  /var/www/12/1/7/-/site/www/php1PWwsF  ), is it normal
or what?.

I've looked up in the PhpManual for copy() and it says it takes two
arguments, in that case if I did put it in this way will it work
copy($img_name1,"/repor_images/$id.$img_name1"); // $img_name1 as the source
and "repor_images/$id.$img_name1" as the destination,

$id is the unique ID from the table which I am passing it as hidden value,



I also have few questions.

Does that mean I have to have 9 copy functions as above, and just change the
"img_nameX"?.

Do I have to mention File size and file type for all the file Fields in the
form or will it be ok just to mention once just above the submit button?.



Thanks again



"Rajesh Fowkar" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Mon, Jan 27, 2003 at 05:05:02PM +0100, Geckodeep wrote:
>
> >Hi,
> >
> >Can any one guide me through the uploading file procedure please?
> >Should I use copy() function to copy the image file to a temp file and
> >rename it to the real name and then reference the name in the data base.
> >Or is there any other way.
> >Should say though my Service Provider does not support exec("cp $picture
> >/full/path/to/joesauto/images/$picture_name") as explained in one of the
> >article in phpbuilder by Willim Samplonius.
>
> All file system functions are not supported ?
>
> Otherwise you case use copy() function rather than exec().
>
> copy($_FILES['Imagefile1']['tmp_name'],
'./full/path/to/joesauto/images/$_FILES['Imagefile1']['tmp_name']');
>
> Here Imagefile1 is the 'name' in the html form.
>
> Picture 1 (jpeg/png/gif)
> 
>
>
> 
>
> HTH
>
> Peace
>
> --
> Rajesh
> :
> [ GNU/Linux One Stanza Tip (LOST) ]###
>
> Sub : Lesser known commands (tac)LOST #165
>
> Everybody has heard of cat, to concatanate files  and print to
> standard output. But have you heard of "tac" ? This reads file
> reverse. Try 'tac somefile.txt' and have a look ...  or better
> still 'tac somesound.au > /dev/audio' ... Enjoy !
>
> <[EMAIL PROTECTED]>
> :



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




Re: [PHP-DB] Help/Advice/Suggestions need to Upload 9 images on one submit button.

2003-01-28 Thread Geckodeep
Hi Rajesh



First of all I'd like to thank you for your time.

I got the script working in a way that it feeds my DB table, but I am
getting this error message: Warning: copy() [function.copy]: Unable to
access in upload1.php on line 28.

this is what I have in the 28th line :
if(!copy($_FILES['img_name1']['tmp_name'],
"./repor_images/$_FILES['img_name1']['tmp_name']")):;

for the moment I am trying it with one field and I am waiting to see if it's
working, and  I'll had the rest with the Captions to go with the images.

One thing I've forgot to say is though in my database instead of just having
the name of the image copied from the source (Form Field) I have the whole
path in the field (  /var/www/12/1/7/-/site/www/php1PWwsF  ), is it normal
or what?.

I've looked up in the PhpManual for copy() and it says it takes two
arguments, in that case if I did put it in this way will it work
copy($img_name1,"/repor_images/$id.$img_name1"); // $img_name1 as the source
and "repor_images/$id.$img_name1" as the destination,

$id is the unique ID from the table which I am passing it as hidden value,



I also have few questions.

Does that mean I have to have 9 copy functions as above, and just change the
"img_nameX"?.

Do I have to mention File size and file type for all the file Fields in the
form or will it be ok just to mention once just above the submit button?.



Thanks again



"Rajesh Fowkar" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Mon, Jan 27, 2003 at 05:05:02PM +0100, Geckodeep wrote:
>
> >Hi,
> >
> >Can any one guide me through the uploading file procedure please?
> >Should I use copy() function to copy the image file to a temp file and
> >rename it to the real name and then reference the name in the data base.
> >Or is there any other way.
> >Should say though my Service Provider does not support exec("cp $picture
> >/full/path/to/joesauto/images/$picture_name") as explained in one of the
> >article in phpbuilder by Willim Samplonius.
>
> All file system functions are not supported ?
>
> Otherwise you case use copy() function rather than exec().
>
> copy($_FILES['Imagefile1']['tmp_name'],
'./full/path/to/joesauto/images/$_FILES['Imagefile1']['tmp_name']');
>
> Here Imagefile1 is the 'name' in the html form.
>
> Picture 1 (jpeg/png/gif)
> 
>
>
> 
>
> HTH
>
> Peace
>
> --
> Rajesh
> :
> [ GNU/Linux One Stanza Tip (LOST) ]###
>
> Sub : Lesser known commands (tac)LOST #165
>
> Everybody has heard of cat, to concatanate files  and print to
> standard output. But have you heard of "tac" ? This reads file
> reverse. Try 'tac somefile.txt' and have a look ...  or better
> still 'tac somesound.au > /dev/audio' ... Enjoy !
>
> <[EMAIL PROTECTED]>
> :



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




Re: [PHP-DB] Help/Advice/Suggestions need to Upload 9 images on one submit button.

2003-01-27 Thread Rajesh Fowkar
On Mon, Jan 27, 2003 at 05:05:02PM +0100, Geckodeep wrote:

>Hi,
>
>Can any one guide me through the uploading file procedure please?
>Should I use copy() function to copy the image file to a temp file and
>rename it to the real name and then reference the name in the data base.
>Or is there any other way.
>Should say though my Service Provider does not support exec("cp $picture
>/full/path/to/joesauto/images/$picture_name") as explained in one of the
>article in phpbuilder by Willim Samplonius.

All file system functions are not supported ?

Otherwise you case use copy() function rather than exec().

copy($_FILES['Imagefile1']['tmp_name'], 
'./full/path/to/joesauto/images/$_FILES['Imagefile1']['tmp_name']');

Here Imagefile1 is the 'name' in the html form.

Picture 1 (jpeg/png/gif)

   
   


HTH

Peace

--
Rajesh
:
[ GNU/Linux One Stanza Tip (LOST) ]###
  
Sub : Lesser known commands (tac)LOST #165

Everybody has heard of cat, to concatanate files  and print to
standard output. But have you heard of "tac" ? This reads file
reverse. Try 'tac somefile.txt' and have a look ...  or better
still 'tac somesound.au > /dev/audio' ... Enjoy !

<[EMAIL PROTECTED]>
:

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




Re: [PHP-DB] Help/Advice/Suggestions need to Upload 9 images on one submit button.

2003-01-27 Thread Geckodeep
Hi John

I've just got that from browsing through the net.

I am in the middle of figuring it out how to implement it.

If I have any more questions I'll post it on the forum. For time being
thanks for your advice.

GD
"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
000201c2c628$a8f0f3b0$7c02a8c0@coconut">news:000201c2c628$a8f0f3b0$7c02a8c0@coconut...
> > Can any one guide me through the uploading file procedure please?
> > Should I use copy() function to copy the image file to a temp file and
> > rename it to the real name and then reference the name in the data
> base.
> > Or is there any other way.
> > Should say though my Service Provider does not support exec("cp
> $picture
> > /full/path/to/joesauto/images/$picture_name") as explained in one of
> the
> > article in phpbuilder by Willim Samplonius.
>
> You should be able to use move_uploaded_file() instead of the exec()
> call.
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
>



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




RE: [PHP-DB] Help/Advice/Suggestions need to Upload 9 images on one submit button.

2003-01-27 Thread John W. Holmes
> Can any one guide me through the uploading file procedure please?
> Should I use copy() function to copy the image file to a temp file and
> rename it to the real name and then reference the name in the data
base.
> Or is there any other way.
> Should say though my Service Provider does not support exec("cp
$picture
> /full/path/to/joesauto/images/$picture_name") as explained in one of
the
> article in phpbuilder by Willim Samplonius.

You should be able to use move_uploaded_file() instead of the exec()
call. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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