Re: [PHP-DB] upload images

2010-05-31 Thread Karl DeSaulniers

Good to hear.

Karl

Sent from losPhone

On May 31, 2010, at 2:41 PM, Emiliano Boragina > wrote:


Thanks a lot... this last solution is the best for me... thanks a  
lot to all!!!


2010/5/31 Karl DeSaulniers 
You are probably right.
The use of the $i and say "photo_".$i.".jpg" would work better.

and change.. :)


Karl



On May 31, 2010, at 2:27 AM, 3dgtech wrote:

It could work, but be careful using timestamp or the php equivalent  
- microtime since this is reliant on gettimeofday(). If naming  
conventions don't mandate a sterilized format I woul still recommend  
using a "confirmed" new variable.

Just my two cents :-)
Eli

On May 30, 2010, at 10:04 PM, Karl DeSaulniers  
 wrote:


Very good point. I did not think of that.
Change it from time() to the date + time() w/ seconds. Every second  
changes. Or better yet, milliseconds. Since that is the speed the  
script runs in I believe.


That should work. Yes?

Karl

Sent from losPhone

On May 30, 2010, at 6:57 PM, 3dgtech  wrote:

The problem with time() is that fast servers are too fast! (you will  
have processed multiple files before time() changes.) Add the $i  
from the for loop in multiple images to the end of your filename.



On May 30, 2010, at 4:33 PM, Karl DeSaulniers   
wrote:


Try this
Try assigning time() to a variable then add that to the rename.

EG:

if ($_FILES['foto']['type'] == "image/jpeg" ||
$_FILES['foto']['type'] == "image/pjpeg"){
//nombre de la imagen
$timestamp = time();
//movemos la imagen.
move_uploaded_file($_FILES['foto']['tmp_name'],
"../fotografias/".$timestamp.".jpg");

HTH,


Karl DeSaulniers
Design Drumm
http://designdrumm.com


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


Karl DeSaulniers
Design Drumm
http://designdrumm.com


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




Re: [PHP-DB] upload images

2010-05-31 Thread Karl DeSaulniers

You are probably right.
The use of the $i and say "photo_".$i.".jpg" would work better.

and change.. :)


Karl


On May 31, 2010, at 2:27 AM, 3dgtech wrote:

It could work, but be careful using timestamp or the php equivalent  
- microtime since this is reliant on gettimeofday(). If naming  
conventions don't mandate a sterilized format I woul still  
recommend using a "confirmed" new variable.

Just my two cents :-)
Eli

On May 30, 2010, at 10:04 PM, Karl DeSaulniers  
 wrote:



Very good point. I did not think of that.
Change it from time() to the date + time() w/ seconds. Every  
second changes. Or better yet, milliseconds. Since that is the  
speed the script runs in I believe.


That should work. Yes?

Karl

Sent from losPhone

On May 30, 2010, at 6:57 PM, 3dgtech  wrote:

The problem with time() is that fast servers are too fast! (you  
will have processed multiple files before time() changes.) Add  
the $i from the for loop in multiple images to the end of your  
filename.



On May 30, 2010, at 4:33 PM, Karl DeSaulniers  
 wrote:



Try this
Try assigning time() to a variable then add that to the rename.

EG:

if ($_FILES['foto']['type'] == "image/jpeg" ||
$_FILES['foto']['type'] == "image/pjpeg"){
 //nombre de la imagen
 $timestamp = time();
 //movemos la imagen.
 move_uploaded_file($_FILES['foto']['tmp_name'],
"../fotografias/".$timestamp.".jpg");

HTH,




Karl DeSaulniers
Design Drumm
http://designdrumm.com



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



Karl DeSaulniers
Design Drumm
http://designdrumm.com


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



Re: [PHP-DB] upload images

2010-05-31 Thread 3dgtech
It could work, but be careful using timestamp or the php equivalent -  
microtime since this is reliant on gettimeofday(). If naming  
conventions don't mandate a sterilized format I woul still recommend  
using a "confirmed" new variable.

Just my two cents :-)
Eli

On May 30, 2010, at 10:04 PM, Karl DeSaulniers   
wrote:



Very good point. I did not think of that.
Change it from time() to the date + time() w/ seconds. Every second  
changes. Or better yet, milliseconds. Since that is the speed the  
script runs in I believe.


That should work. Yes?

Karl

Sent from losPhone

On May 30, 2010, at 6:57 PM, 3dgtech  wrote:

The problem with time() is that fast servers are too fast! (you  
will have processed multiple files before time() changes.) Add the  
$i from the for loop in multiple images to the end of your filename.



On May 30, 2010, at 4:33 PM, Karl DeSaulniers  
 wrote:



Try this
Try assigning time() to a variable then add that to the rename.

EG:

if ($_FILES['foto']['type'] == "image/jpeg" ||
$_FILES['foto']['type'] == "image/pjpeg"){
 //nombre de la imagen
 $timestamp = time();
 //movemos la imagen.
 move_uploaded_file($_FILES['foto']['tmp_name'],
"../fotografias/".$timestamp.".jpg");

HTH,




Karl DeSaulniers
Design Drumm
http://designdrumm.com



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



Re: [PHP-DB] upload images

2010-05-30 Thread 3dgtech
The problem with time() is that fast servers are too fast! (you will  
have processed multiple files before time() changes.) Add the $i from  
the for loop in multiple images to the end of your filename.



On May 30, 2010, at 4:33 PM, Karl DeSaulniers   
wrote:



Try this
Try assigning time() to a variable then add that to the rename.

EG:

if ($_FILES['foto']['type'] == "image/jpeg" ||
$_FILES['foto']['type'] == "image/pjpeg"){
   //nombre de la imagen
   $timestamp = time();
   //movemos la imagen.
   move_uploaded_file($_FILES['foto']['tmp_name'],
"../fotografias/".$timestamp.".jpg");

HTH,




Karl DeSaulniers
Design Drumm
http://designdrumm.com



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



Re: [PHP-DB] upload images

2010-05-30 Thread Karl DeSaulniers

Try this
Try assigning time() to a variable then add that to the rename.

EG:

if ($_FILES['foto']['type'] == "image/jpeg" ||
$_FILES['foto']['type'] == "image/pjpeg"){
//nombre de la imagen
$timestamp = time();
//movemos la imagen.
move_uploaded_file($_FILES['foto']['tmp_name'],
"../fotografias/".$timestamp.".jpg");

HTH,




Karl DeSaulniers
Design Drumm
http://designdrumm.com



[PHP-DB] upload images

2010-05-30 Thread Emiliano Boragina
Hello, I want to do an Admin to upload more than one picture per clic, I
must can upload one or more Pictures. This I know how is it... but I want
rename each picture, not with , for example, "001" but with some function,
some... thing that rename the file. I am using this:

if(isset($_POST['submit'])){
$error = false;
// si hay imagen.
if (is_uploaded_file($_FILES['foto']['tmp_name'])) {
//revisamos que sea jpg
if ($_FILES['foto']['type'] == "image/jpeg" ||
$_FILES['foto']['type'] == "image/pjpeg"){
//nombre de la imagen
$foto = time().".jpg";
//movemos la imagen.
move_uploaded_file($_FILES['foto']['tmp_name'],
"../fotografias/".$foto);
}else{
$error = true;
$errormsg = "Formato no válido para archivo de
imagen";
}
} else {
//imagen no se pudo subir o no seleccionaron.
$error=true;
$errormsg = "Error al cargar imagen: " .
$_FILES['foto']['name'];
}//fin file upload.

//continuamos con el insert.
//si hay error no hay imagen.
if($error){
$foto = "";
}

$titulo = $_POST['titulo'];
$texto = $_POST['texto'];
$categoria = $_POST['categoria'];
$habilitar = $_POST['habilitar'];
$campos = "titulo,texto,foto,categoria,habilitar";
$valores = "'$titulo','$texto','$foto','$categoria','$habilitar'";
//nos conectamos a la bd.
$cnx = conectar();
$res = mysql_query("INSERT INTO registros ($campos)
VALUES($valores)") or die (mysql_error());
//cerramos la conexión.
mysql_close($cnx);
//mensaje de exito.
$mensaje = "El registro ha sido ingresado";
exit;
}

?>

If you can help me... I thanks a lot... If not... I thanks a lot anyway =D
Best regards!

--
Emiliano Boragina
desarrollos + comunicación
--
+ 15 33 92 60 02
» emiliano.borag...@gmail.com
--
© 2010
--



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



Re: [PHP-DB] upload multiple files and rename wih time()

2010-02-07 Thread Chris

Emiliano Boragina wrote:

Hello php fellows,

 


I have two codes to upload multiple files, works very well, but I cant
rename the files... really i dont know...


The code looks ok. Do you get an error message? If not, turn up 
error_reporting and enable display_errors:


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

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


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



[PHP-DB] upload multiple files and rename wih time()

2010-02-06 Thread Emiliano Boragina
Hello php fellows,

 

I have two codes to upload multiple files, works very well, but I cant
rename the files... really i dont know...

CODE1:

 

$uploadfile = $uploaddir . basename($_FILES[fotog][name][$key]); 


  if (is_uploaded_file($_FILES['fotog']['tmp_name'][$key]))  


  { 


 //revisamos que sea jpg 


 if ($_FILES['fotog']['type'][$key] == "image/jpeg" ||
$_FILES['fotog']['type'][$key] == "image/pjpeg") 


 { 


//nombre de la imagen 


$fotog = time().".jpg";; 


//movemos la imagen. 


move_uploaded_file($_FILES['fotog']['tmp_name'][$key],
"../originales/".$fotog); 


 }else{ 


$error = true; 


$errormsg = "Formato no válido para archivo de imagen"; 


 } 


  } else { 


 //imagen no se pudo subir o no seleccionaron. 


 $error=true; 


 $errormsg = "Error al cargar imagen: " .
$_FILES['fotog']['name'][$key]; 


  }//fin file upload. 


  


  //continuamos con el insert. 


  //si hay error no hay imagen. 


  if($error){ 


 $fotog = "N/A"; 


  }

and CODE2:

 

$uploadfile = $uploaddir . basename($_FILES[fotog][name][$key]);  


  //echo $uploadfile; 


  if (move_uploaded_file($_FILES['fotog']['tmp_name'][$key],
$uploadfile))  


  {  


 echo $value . ' uploaded'; 


  }

 

How can I do this?

Thanks a lot,

 

 

+ +
   Emiliano Boragina | Diseño & Comunicación
   emiliano.borag...@gmail.com  | 15 33 92 60 02
+ +

 



Re: [PHP-DB] upload file

2008-07-05 Thread Bastien Koert
On Sat, Jul 5, 2008 at 5:50 PM, Roberto Carlos García Luís <
[EMAIL PROTECTED]> wrote:

> Ron,
>
> You can use a Editor that have the service.
>
> For example Dreamweaver or create a link to a ftp server.
>
>
>
> El 05/07/2008, a las 10:52 a.m., Ron escribió:
>
>  Is it possible to upload directly on a remote server using php file
>> upload?
>> so that i will have everything on the remote server instead of in the
>> local
>> server?
>>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
php supports creating an ftp server to access the remote server

-- 

Bastien

Cat, the other other white meat


Re: [PHP-DB] upload file

2008-07-05 Thread Roberto Carlos García Luís

Ron,

You can use a Editor that have the service.

For example Dreamweaver or create a link to a ftp server.



El 05/07/2008, a las 10:52 a.m., Ron escribió:

Is it possible to upload directly on a remote server using php file  
upload?
so that i will have everything on the remote server instead of in  
the local

server?



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



Re: [PHP-DB] upload file

2008-07-05 Thread Ron
Hi Sir,

Is it possible to upload directly on a remote server using php file upload?
so that i will have everything on the remote server instead of in the local
server?

regards,
ron



On Sat, 5 Jul 2008 10:55:48 -0400, Bastien Koert wrote
> On Fri, Jul 4, 2008 at 11:35 PM, Ron <[EMAIL PROTECTED]> wrote:
> 
> > Hi,
> >
> > I dont know if this question is allowed here:
> >
> > i have a web interface that let's user upload file, but i have 2 servers
> >  and use dns round-robin. when a user uploads a file, it will only be
> > uploaded on one of the servers.
> >
> > how can i make sure that when a file is uploaded on one server it will also
> > be transferred on the other server?
> >
> > can i use php to execute the rsync command, and transfer the uploaded file
> > to the other server? or are there other ways to transfer? thank you
> >
> > regards,
> > ron
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> why not designate one place to store that data? then all files will 
> be in the same place and you can avoid wasting space with duplicated 
> data?
> --
> 
> Bastien
> 
> Cat, the other other white meat


--
SilverbackASP Inc.


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



Re: [PHP-DB] upload file

2008-07-05 Thread Bastien Koert
On Fri, Jul 4, 2008 at 11:35 PM, Ron <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I dont know if this question is allowed here:
>
> i have a web interface that let's user upload file, but i have 2 servers
>  and use dns round-robin. when a user uploads a file, it will only be
> uploaded on one of the servers.
>
> how can i make sure that when a file is uploaded on one server it will also
> be transferred on the other server?
>
> can i use php to execute the rsync command, and transfer the uploaded file
> to the other server? or are there other ways to transfer? thank you
>
> regards,
> ron
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

why not designate one place to store that data? then all files will be in
the same place and you can avoid wasting space with duplicated data?
-- 

Bastien

Cat, the other other white meat


Re: [PHP-DB] upload file [heur]

2008-07-04 Thread Chris Verges
Hey Ron,

One method that I've used in the past is to dedicate one server based on
some kind of hashing algorithm (username?) to be the upload server.  That
server should have a unique DNS entry (www2.domain.ext) which all URLs that
need upload processing refer to.

The other way to do it is to store the file as a blob object in a database.
That will scale regardless of number of web servers, but does take a hit in
terms of storing in the DB.

What about other filesystem solutions like NFS?

Thanks,
Chris



On 7/4/08 8:35 PM, "Ron" <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I dont know if this question is allowed here:
> 
> i have a web interface that let's user upload file, but i have 2 servers
>   and use dns round-robin. when a user uploads a file, it will only be
> uploaded on one of the servers.
> 
> how can i make sure that when a file is uploaded on one server it will
> also be transferred on the other server?
> 
> can i use php to execute the rsync command, and transfer the uploaded
> file to the other server? or are there other ways to transfer? thank you
> 
> regards,
> ron


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



[PHP-DB] upload file

2008-07-04 Thread Ron

Hi,

I dont know if this question is allowed here:

i have a web interface that let's user upload file, but i have 2 servers 
 and use dns round-robin. when a user uploads a file, it will only be 
uploaded on one of the servers.


how can i make sure that when a file is uploaded on one server it will 
also be transferred on the other server?


can i use php to execute the rsync command, and transfer the uploaded 
file to the other server? or are there other ways to transfer? thank you


regards,
ron

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



RE: [PHP-DB] Upload images with minimun effort from final user

2005-09-26 Thread Bastien Koert
Its pretty simple, the section in the manual has lots of detail on handling 
file uploads. The file's name is accessible thru


$name = $_FILES['formFieldName']['name'];

In this case, I would also suggest that you create the name of the image to 
store it on the file system..otherwise you may end up with N number of files 
with the same name (ie mycat.jpg). By associating another randomly generated 
name with the image as the true name, you should avoid that issue...


Bastien



From: "David Arroyo" <[EMAIL PROTECTED]>
To: 
Subject: [PHP-DB] Upload images with minimun effort from final user
Date: Mon, 26 Sep 2005 19:48:24 +0200

Hi @ll,

I have to make an interface for a newspaper site, where users can upload
news including images.



I want to store the image's name in a field of my NEWS table, in order to
catch it with an  tag later, but I don't want people has to upload the
image, remember its name, and put it as another field in the form.



Can anyone help me with an example, tutorial or any idea?



Thanks in advance,

David.





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



[PHP-DB] Upload images with minimun effort from final user

2005-09-26 Thread David Arroyo
Hi @ll,

I have to make an interface for a newspaper site, where users can upload
news including images.

 

I want to store the image's name in a field of my NEWS table, in order to
catch it with an  tag later, but I don't want people has to upload the
image, remember its name, and put it as another field in the form.

 

Can anyone help me with an example, tutorial or any idea?

 

Thanks in advance,

David.

 



Re: [PHP-DB] Upload and Display images with Mysql

2004-05-24 Thread Rachel Rodriguez

--- Kpromos <[EMAIL PROTECTED]> wrote:
> Dears All,
> 
> I'm looking for a simple script that will permitme
> to upload images in a mysql database, calling out
> the images with a function from a mysql database
> (calling them from an id variable). I have just
> tried this tutorial
>
http://www.phpbuilder.com/columns/florian19991014.php3
> but it seems to me that there's nothing to do, as
> images aren't displayed even if all seems to
> function correctly. The doubt is that images are
> stored as bynary files System.Byte[], so it may be
> that I can use the simple  src="view.php?id=$id">.
> I'm testing all in my Windows PC. Anybody can help
> me? 

I actually remember looking at that PHPBuilder.com
article a few years ago.  Unless you're in a situation
where you are required to store your graphic in the
database, it would be better to store the graphic in
the file system of your operating system, and then
merely capture the path to the file in a column of the
database.  So, for example, if you upload your a
picture called "myPhoto.jpg" to a path (assuming
you're on UNIX/Linux) called "/home/myDirectory", then
the full path to your picture would be:
"/home/myDirectory/photos/myPhoto.jpg" (without the
quotes, of course).

In the column of your database, INSERT the path to
your photo.  For example:

$sql = "INSERT into Table1
(id, photo)
VALUES (null,
'/home/myDirectory/photos/myPhoto.jpg')";

Later on, when you want to view your photo, you would
do a SELECT statement on the table to get the path to
your photo and then echo it out to the browser.  For
example, if the "id" of your photo was "1":

$query = "SELECT Table1.photo
  WHERE Table1.id = '1'";

$result = mysql_query($query, $connection_info_here)
or die("Couldn't pull photo.");

while ($row = mysql_fetch_array($result))
{
$photo = $row['photo'];
}

To display the photo, as you already know, just use
 tags and echo statement:



I have not included any error checking.  This is just
a skeleton way of doing it.

The PHP manual does a good job of explaining file
uploads which you'll be required to do for uploads
regardless of where you store the graphic (either in
the file system or in the database).

http://us4.php.net/features.file-upload


=
~Rachel




__
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

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



[PHP-DB] Upload and Display images with Mysql

2004-05-24 Thread Kpromos
Dears All,

I'm looking for a simple script that will permitme to upload images in a mysql 
database, calling out the images with a function from a mysql database (calling them 
from an id variable). I have just tried this tutorial 
http://www.phpbuilder.com/columns/florian19991014.php3 but it seems to me that there's 
nothing to do, as images aren't displayed even if all seems to function correctly. The 
doubt is that images are stored as bynary files System.Byte[], so it may be that I can 
use the simple .
I'm testing all in my Windows PC. Anybody can help me? 

Thanks for all,
Alessandro Folghera (Italy)

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



Re: [PHP-DB] upload files into MySQL database

2004-05-11 Thread John W. Holmes
From: "PHPDiscuss - PHP Newsgroups and mailing lists"
<[EMAIL PROTECTED]>

> I have problem for downloading files from MySQL database.
> Although I store and I see the filename and the extension in the database,
> when I try to download it, if there are blank spaces inside the filename,
> like "my book store.doc"
> I cannot open it and see it.

You shouldn't use spaces in file names.

Use urlencode() on the filename before you create a link to it.

---John Holmes...

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



[PHP-DB] upload files into MySQL database

2004-05-11 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Hello,

I have problem for downloading files from MySQL database.
Although I store and I see the filename and the extension in the database,
when I try to download it, if there are blank spaces inside the filename,
like "my book store.doc"
I cannot open it and see it.

Best regards
Stelios Karapas

email: [EMAIL PROTECTED]

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



[PHP-DB] Upload / Load Image File to MySQL

2004-03-28 Thread Wijaya
Need help / example how to upload / load image file to MySQL
Thank's

Wijaya

__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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



[PHP-DB] upload binary into postgres

2004-02-09 Thread Hiro
Hi!

I would like to upload binary data into the PorstgreSQL.
Does anyone know how to upload the code? I do not want to use
OID. I want to insert binary direct into table.
I create table field bytea. Is it correct?

Pelase teach me how!



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


Re: [PHP-DB] Upload multiple files?

2003-08-29 Thread colbey

Very simple...

Call you files being uplaoded file1, file2, fileX in the HTML form..

[html]






[/html]

Then process with code like this:

[code]
$STARTFILE = 1;
$ONFILE = "file" . $STARTFILE;

while (isset($HTTP_POST_FILES["$ONFILE"])) {

  // Try!
  $SrcPathFile = $HTTP_POST_FILES["$ONFILE"]["tmp_name"];
  $SrcFileType = $HTTP_POST_FILES["$ONFILE"]["type"];
  $DstFileName = $HTTP_POST_FILES["$ONFILE"]["name"];

  // File Processing
  if (file_exists($SrcPathFile)) {

// handle it
  }

  $STARTFILE ++;
  $ONFILE = "file" . $STARTFILE;
}
[/code]

You may want to update the $HTTP_POST_FILES -> $_FILES depending on PHP
version, etc...

Code from: http://php.dreamwerx.net/forums/viewtopic.php?t=6

good luck..



On Fri, 29 Aug 2003, Chris Payne wrote:

> Hi there everyone,
>
> I have created a newsletter system where you can do lots of nice things, one of the 
> things is to be able to upload your images for the newsletter via the interface, 
> unfortunately you have to do them 1 at a time.  Is it possible to be able to select 
> multiple images in 1 go?
>
> The image info is stored in a DB and the images themselves are on the server, this 
> way I can do lots of nice things to manage the images that have been uploaded 
> without having to access the filesystem too much (I love PHP and MySQL, makes it so 
> easy).
>
> Thanks everyone.
>
> Chris

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



RE: [PHP-DB] Upload multiple files?

2003-08-29 Thread Aaron Wolski
The other option is...

You create a pop-up menu system.

That have the file form field to select from a location. When you upload
the image it populates a HTML display table so you can see it and also
allows you to select another image. 

When you are done.. you close the pop-up menu and that's that!

You got options. Just a matter of how much time you wanna invest ;)

Aaron

> -Original Message-
> From: Chris Payne [mailto:[EMAIL PROTECTED]
> Sent: August 29, 2003 5:45 PM
> To: php
> Subject: Re: [PHP-DB] Upload multiple files?
> 
> Hi there,
> 
> U you know what they say, keep it simple and you're probably right
you
> know, I was thinking it would be more complex but i'll have a play
with
> that
> idea (Isn't it amazing how sometime we try to make things harder for
> ourselves than they need be?).
> 
> Thanks for pointing that solution out, it SHOULD work :-)
> 
> Chris
> 
> > Well...
> >
> > Having never done this I would assume it's the same with and form
field
> > you want to use as an array (multiple selections).
> >
> > Create a few different fileselect fields all with the same name but
> > adding in [] to make it an array.
> >
> > Then just loop through the array.. copying the file to the server
and
> > the filename info to the DB.
> >
> > Rather simplistic I know but it's a solution.
> >
> > HTH
> >
> > Aaron
> >
> > > -Original Message-
> > > From: Chris Payne [mailto:[EMAIL PROTECTED]
> > > Sent: August 29, 2003 5:38 PM
> > > To: php
> > > Subject: [PHP-DB] Upload multiple files?
> > >
> > > Hi there everyone,
> > >
> > > I have created a newsletter system where you can do lots of nice
> > things,
> > > one of the things is to be able to upload your images for the
> > newsletter
> > > via the interface, unfortunately you have to do them 1 at a time.
Is
> > it
> > > possible to be able to select multiple images in 1 go?
> > >
> > > The image info is stored in a DB and the images themselves are on
the
> > > server, this way I can do lots of nice things to manage the images
> > that
> > > have been uploaded without having to access the filesystem too
much (I
> > > love PHP and MySQL, makes it so easy).
> > >
> > > Thanks everyone.
> > >
> > > Chris
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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



Re: [PHP-DB] Upload multiple files?

2003-08-29 Thread Chris Payne
Hi there,

U you know what they say, keep it simple and you're probably right you
know, I was thinking it would be more complex but i'll have a play with that
idea (Isn't it amazing how sometime we try to make things harder for
ourselves than they need be?).

Thanks for pointing that solution out, it SHOULD work :-)

Chris

> Well...
>
> Having never done this I would assume it's the same with and form field
> you want to use as an array (multiple selections).
>
> Create a few different fileselect fields all with the same name but
> adding in [] to make it an array.
>
> Then just loop through the array.. copying the file to the server and
> the filename info to the DB.
>
> Rather simplistic I know but it's a solution.
>
> HTH
>
> Aaron
>
> > -Original Message-
> > From: Chris Payne [mailto:[EMAIL PROTECTED]
> > Sent: August 29, 2003 5:38 PM
> > To: php
> > Subject: [PHP-DB] Upload multiple files?
> >
> > Hi there everyone,
> >
> > I have created a newsletter system where you can do lots of nice
> things,
> > one of the things is to be able to upload your images for the
> newsletter
> > via the interface, unfortunately you have to do them 1 at a time.  Is
> it
> > possible to be able to select multiple images in 1 go?
> >
> > The image info is stored in a DB and the images themselves are on the
> > server, this way I can do lots of nice things to manage the images
> that
> > have been uploaded without having to access the filesystem too much (I
> > love PHP and MySQL, makes it so easy).
> >
> > Thanks everyone.
> >
> > Chris
>
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



RE: [PHP-DB] Upload multiple files?

2003-08-29 Thread Aaron Wolski
Well...

Having never done this I would assume it's the same with and form field
you want to use as an array (multiple selections).

Create a few different fileselect fields all with the same name but
adding in [] to make it an array.

Then just loop through the array.. copying the file to the server and
the filename info to the DB.

Rather simplistic I know but it's a solution.

HTH

Aaron

> -Original Message-
> From: Chris Payne [mailto:[EMAIL PROTECTED]
> Sent: August 29, 2003 5:38 PM
> To: php
> Subject: [PHP-DB] Upload multiple files?
> 
> Hi there everyone,
> 
> I have created a newsletter system where you can do lots of nice
things,
> one of the things is to be able to upload your images for the
newsletter
> via the interface, unfortunately you have to do them 1 at a time.  Is
it
> possible to be able to select multiple images in 1 go?
> 
> The image info is stored in a DB and the images themselves are on the
> server, this way I can do lots of nice things to manage the images
that
> have been uploaded without having to access the filesystem too much (I
> love PHP and MySQL, makes it so easy).
> 
> Thanks everyone.
> 
> Chris

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



[PHP-DB] Upload multiple files?

2003-08-29 Thread Chris Payne
Hi there everyone,

I have created a newsletter system where you can do lots of nice things, one of the 
things is to be able to upload your images for the newsletter via the interface, 
unfortunately you have to do them 1 at a time.  Is it possible to be able to select 
multiple images in 1 go?

The image info is stored in a DB and the images themselves are on the server, this way 
I can do lots of nice things to manage the images that have been uploaded without 
having to access the filesystem too much (I love PHP and MySQL, makes it so easy).

Thanks everyone.

Chris

[PHP-DB] upload again

2003-02-12 Thread Ryan Holowaychuk
I have an upload set up, and now I need to do another one that will go
to an other server.  I can find how I can get the script to login to
another server with a user and pass if needed and then carry on and send
the file.
 
This is what I have for a local one now
 
$copied1 =
"/location/on/server/".basename($HTTP_POST_FILES['userfile1']['name']);
 
Is this possible?? That I want it to go to another server?
 
Thanks
Ryan



Re: [PHP-DB] upload time out

2003-01-29 Thread Jason Wong
On Thursday 30 January 2003 04:39, Ryan Holowaychuk wrote:
> Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
> allocate 4000 bytes) in Unknown on line 0
>
> I have gone in and made some changes to allow the file upload larger
> files.  I have gone in as well and turned on the messaging for now so
> that I can see things like the above error.
>
> I believe that this is the area that I am to make the change, but when I
> increase the memory limit I still get the same error
>
> ;;;
> ; Resource Limits ;
> ;;;
>
> max_execution_time = 320 ; Maximum execution time of each script, in
> seconds (default 30)
> memory_limit = 8M  ; Maximum amount of memory a script may consume
> (8MB)

I think PHP keeps the uploaded file(s) in memory until they have completely 
finished uploading and are ready to be written to disk. Thus if you're trying 
to upload a 10MB file you would probably have to increase the memory_limit to 
18MB to be on the safe side.

> as to the question if I should use FTP, yes I can and do for most, but I
> am trying to get this working for most as this is a lot easier for
> people to send files, so if I can get it working for larger files then
> things will fly

Remember HTTP uploads doesn't allow you to resume transfer. Thus if a file was 
99% uploaded and an error occurs you have a very unhappy user ;-)

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
And miles to go before I sleep.
-- Robert Frost
*/


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




RE: [PHP-DB] upload time out

2003-01-29 Thread Ryan Holowaychuk
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
allocate 4000 bytes) in Unknown on line 0

I have gone in and made some changes to allow the file upload larger
files.  I have gone in as well and turned on the messaging for now so
that I can see things like the above error.

I believe that this is the area that I am to make the change, but when I
increase the memory limit I still get the same error

;;;
; Resource Limits ;
;;;

max_execution_time = 320 ; Maximum execution time of each script, in
seconds (default 30)
memory_limit = 8M  ; Maximum amount of memory a script may consume
(8MB)

as to the question if I should use FTP, yes I can and do for most, but I
am trying to get this working for most as this is a lot easier for
people to send files, so if I can get it working for larger files then
things will fly

Thanks

-Original Message-
From: Hutchins, Richard [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, January 29, 2003 11:00 AM
To: 'Ryan Holowaychuk'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] upload time out

Yeah, it's a configuration directive, check here:

http://www.php.net/manual/en/configuration.directives.php#ini.upload-max
-fil
esize

If you're moving 10MB, is it possible to use FTP instead? Don't know
your
situation. Just a suggestion.

> -Original Message-
> From: Ryan Holowaychuk [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 29, 2003 1:58 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] upload time out
> 
> 
> I have an upload page on my website, and when I do large 
> files via this
> process, system times out. 
> 
> Are there some setting that I need to "tweek" to allow this process to
> finish, so if some one was to send a 10 meg file it will go through.
> Right now it will not even copy any part of the file.
> 
> Thanks
> Ryan
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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



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




RE: [PHP-DB] upload time out

2003-01-29 Thread Hutchins, Richard
Yeah, it's a configuration directive, check here:

http://www.php.net/manual/en/configuration.directives.php#ini.upload-max-fil
esize

If you're moving 10MB, is it possible to use FTP instead? Don't know your
situation. Just a suggestion.

> -Original Message-
> From: Ryan Holowaychuk [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 29, 2003 1:58 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] upload time out
> 
> 
> I have an upload page on my website, and when I do large 
> files via this
> process, system times out. 
> 
> Are there some setting that I need to "tweek" to allow this process to
> finish, so if some one was to send a 10 meg file it will go through.
> Right now it will not even copy any part of the file.
> 
> Thanks
> Ryan
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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




[PHP-DB] upload time out

2003-01-29 Thread Ryan Holowaychuk
I have an upload page on my website, and when I do large files via this
process, system times out. 

Are there some setting that I need to "tweek" to allow this process to
finish, so if some one was to send a 10 meg file it will go through.
Right now it will not even copy any part of the file.

Thanks
Ryan



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




RE: [PHP-DB] Upload Images...

2002-12-27 Thread Boaz Yahav
Is there something you don't know how to do or are you just looking for
something ready made?

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.




-Original Message-
From: Doug Coning [mailto:[EMAIL PROTECTED]] 
Sent: Friday, December 27, 2002 10:29 PM
To: Boaz Yahav; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Upload Images...


Yes, but do you know where I can find a sample of merging the upload
script with the Update script?

Thanks!!!

Doug
- Original Message -
From: "Boaz Yahav" <[EMAIL PROTECTED]>
To: "Doug Coning" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, December 27, 2002 1:09 PM
Subject: RE: [PHP-DB] Upload Images...


> I'm guessing it's better for the people that will use this page to 
> have it all in one page but less convenient for you to develop it like

> that :)
>
> Sincerely
>
> berber
>
> Visit http://www.weberdev.com/ Today!!!
> To see where PHP might take you tomorrow.
>
>
> -Original Message-
> From: Doug Coning [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 27, 2002 9:09 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Upload Images...
>
>
> Hi All,
>
> I've got a question about creating an Update page.  I have an update 
> page that has a form with about 15 fields in it that update records in

> my MySQL database.  One of the fields is an IMAGE field that stores an

> image name.  I want to this PHP page to do several things:
>
> 1) edit and update the fields.
> 2) allow the user to upload new images to replace current images and 
> then
> update the image name in the image column.
>
> Is this best served as 1 page or is it better to break this down into 
> a page to upload images and a separate page to edit the content?
>
> Thank you.
>
> Doug
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>




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




RE: [PHP-DB] Upload Images...

2002-12-27 Thread Aaron Wolski
Write your own.

You'll spend more time trying to find something than it will take you to
create your own. Plus.. anything that you do find will need
modifications anyway so may as well write your own.

Define the scope/parameters
Write out the logic
Program the script

:)

Aaron

-Original Message-
From: Doug Coning [mailto:[EMAIL PROTECTED]] 
Sent: December 27, 2002 3:29 PM
To: Boaz Yahav; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Upload Images...

Yes, but do you know where I can find a sample of merging the upload
script
with the Update script?

Thanks!!!

Doug
- Original Message -
From: "Boaz Yahav" <[EMAIL PROTECTED]>
To: "Doug Coning" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, December 27, 2002 1:09 PM
Subject: RE: [PHP-DB] Upload Images...


> I'm guessing it's better for the people that will use this page to
have
> it all in one page
> but less convenient for you to develop it like that :)
>
> Sincerely
>
> berber
>
> Visit http://www.weberdev.com/ Today!!!
> To see where PHP might take you tomorrow.
>
>
> -Original Message-
> From: Doug Coning [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 27, 2002 9:09 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Upload Images...
>
>
> Hi All,
>
> I've got a question about creating an Update page.  I have an update
> page that has a form with about 15 fields in it that update records in
> my MySQL database.  One of the fields is an IMAGE field that stores an
> image name.  I want to this PHP page to do several things:
>
> 1) edit and update the fields.
> 2) allow the user to upload new images to replace current images and
> then
> update the image name in the image column.
>
> Is this best served as 1 page or is it better to break this down into
a
> page to upload images and a separate page to edit the content?
>
> Thank you.
>
> Doug
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>




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




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




Re: [PHP-DB] Upload Images...

2002-12-27 Thread Doug Coning
Yes, but do you know where I can find a sample of merging the upload script
with the Update script?

Thanks!!!

Doug
- Original Message -
From: "Boaz Yahav" <[EMAIL PROTECTED]>
To: "Doug Coning" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, December 27, 2002 1:09 PM
Subject: RE: [PHP-DB] Upload Images...


> I'm guessing it's better for the people that will use this page to have
> it all in one page
> but less convenient for you to develop it like that :)
>
> Sincerely
>
> berber
>
> Visit http://www.weberdev.com/ Today!!!
> To see where PHP might take you tomorrow.
>
>
> -Original Message-
> From: Doug Coning [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 27, 2002 9:09 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Upload Images...
>
>
> Hi All,
>
> I've got a question about creating an Update page.  I have an update
> page that has a form with about 15 fields in it that update records in
> my MySQL database.  One of the fields is an IMAGE field that stores an
> image name.  I want to this PHP page to do several things:
>
> 1) edit and update the fields.
> 2) allow the user to upload new images to replace current images and
> then
> update the image name in the image column.
>
> Is this best served as 1 page or is it better to break this down into a
> page to upload images and a separate page to edit the content?
>
> Thank you.
>
> Doug
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>




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




RE: [PHP-DB] Upload Images...

2002-12-27 Thread Boaz Yahav
I'm guessing it's better for the people that will use this page to have
it all in one page
but less convenient for you to develop it like that :)

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-Original Message-
From: Doug Coning [mailto:[EMAIL PROTECTED]] 
Sent: Friday, December 27, 2002 9:09 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Upload Images...


Hi All,

I've got a question about creating an Update page.  I have an update
page that has a form with about 15 fields in it that update records in
my MySQL database.  One of the fields is an IMAGE field that stores an
image name.  I want to this PHP page to do several things:

1) edit and update the fields.
2) allow the user to upload new images to replace current images and
then
update the image name in the image column.

Is this best served as 1 page or is it better to break this down into a
page to upload images and a separate page to edit the content?

Thank you.

Doug




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


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




[PHP-DB] Upload Images...

2002-12-27 Thread Doug Coning
Hi All,

I've got a question about creating an Update page.  I have an update page
that has a form with about 15 fields in it that update records in my MySQL
database.  One of the fields is an IMAGE field that stores an image name.  I
want to this PHP page to do several things:

1) edit and update the fields.
2) allow the user to upload new images to replace current images and then
update the image name in the image column.

Is this best served as 1 page or is it better to break this down into a page
to upload images and a separate page to edit the content?

Thank you.

Doug




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




Re: [PHP-DB] upload data to MySql

2002-11-14 Thread Anthony
Just wrote an app that does this myself.  Loads inmages/movies/audio and 
what not into a database.  I've posted the code below, feel free to try 
it out.  This file does all the uploading.  It took me a while to figure 
out how to do this, so don;t worry it it seams like it's tough.  I 
actualy store the files dirrectly in the databse in a longblob, it may 
be better to save the files in a folder (how I most people do it).  Feel 
free to ask any questions you have.  The app is in beta right now, it 
will go on www.supras.com when its done.

HTH - Anthony


/* add.php  -- part of the SOGI website media module
   writen by Knightrider version 1.0 9-24-02

   This script will alow a user to upload files into the database
*/

// lets include some files so that this crap will work
include 'database.inc';
include 'functions.inc';

// get some info from the config record so we know about upload settings
getConfig();
//echo "Diag mode:";
//print_r($HTTP_POST_VARS);

  if (empty($_POST['short']) || empty($_FILES['newfile']) || 
empty($_POST['gen']) || empty($_POST['category']))
  {
?>
http://www.w3.org/TR/html4/loose.dtd";>


  SOGI Media Module - Upload a file
	  


	
		
			
Media - Add a file
			
			 
			
			
		
	
	
	
	
	

	
	Upload an Image File
	Please fill in the details below to upload your file.
		Fields shown in red are mandatory.
	
		
			if (isset($_POST['submit']))
echo "You did not enter info into a required field!";
		?>
	




	
	   		Short description:
		
   	
			
	
	
		
			Long Description
		
		
			
		
	
		
			Uploaded by:
		
		
		
	
		
	   Select a Car Type
	   
	   
			Select One

			
	
		
			Select a media depiction
		
			
Select One

	 	
	   



   File:
   

	
  
	   
	   
	  


	
	
	
	

 	 
 		
  

Browse Media


  




  }
  else
  {


	$s="";	// set the var blank to add to query
 // Was a file uploaded?
	if (is_uploaded_file($_FILES['newfile']['tmp_name']))
	{			
			// open and read the uploaded file
			$file1=fopen($_FILES['newfile']['tmp_name'], "r");
			$file=fread($file1, $_FILES['newfile']['size']);

			// Escape special characters in the file
			$file=AddSlashes($file);
			
			$tmp=split('/',$_FILES['newfile']['type']);
			if ($tmp[0]=='image')
{
	$size = getimagesize($_FILES['newfile']['tmp_name']);
	$s=",width='{$size[0]}', height='{$size[1]}'";
}		
			
		}
	else
$file=NULL;

	$insertQuery = "INSERT INTO media_files SET
	 
	shortdesc='{$_POST['short']}',
		longdesc='{$_POST['longdesc']}',
		username='{$_POST['user']}',
		mimetype='{$_FILES['newfile']['type']}',
		filedata='{$file}',
		filesize='{$_FILES['newfile']['size']}',
		filename='{$_FILES['newfile']['name']}',
		uploaded=CURDATE(),
		category1='{$_POST['gen']}',
		category2='{$_POST['category']}'		
		";
	$insertQuery.=$s;
	// check for unknown file type, if it's unknown, automatically censor it.		
	$foo=split("/",$_FILES['newfile']['type']);
	if (AUTOCENSOR or !($foo[0]=="image" or $foo[0]=="video" or 
$foo[0]=="audio"))
		$insertQuery.=", censor='t'";
		
if ((doQuery($insertQuery)))
	 
	{
			//&& @ mysql_affected_rows() == 1)
			$lastid=mysql_insert_id();
			$statement="INSERT INTO media_stats SET id=$lastid";
			if ((doQuery($statement)))
{
				header("Location: receipt.php?status=T&file=$lastid");		
}
			else
{
	echo getError(); 

}
		}
 else
	 
	echo getError();
  }
?>


HTH - Anthony






Boa Constructor wrote:
I'm new to file uploads, however I managed to get it working.  Are you
copying the file after its been uploaded?  If not you need to do this as the
temp file is destroyed after the script has finished running so you need to
copy it if you wish to store it.  You also will have to chmod 777 to the
directory you wish to copy the file to.  It may help if we can see the
tutorial to try and find out exactly what you are doing.

I've been working from "Build Your Own Database Driven Website Using PHP &
MySQL" By Kevin Yank and its really helpful it covers file uploads.  I'm
also using "PHP and MySQL Web Development" by Luke Wellling and Laura
Thomson.  This covers file uploads also, infact I found it 

Re: [PHP-DB] upload data to MySql

2002-11-14 Thread Anthony
Just wrote an app that does this myself.  Loads inmages/movies/audio and 
what not into a database.  I've posted the code below, feel free to try 
it out.  This file does all the uploading.  It took me a while to figure 
out how to do this, so don;t worry it it seams like it's tough.  I 
actualy store the files dirrectly in the databse in a longblob, it may 
be better to save the files in a folder (how I most people do it).  Feel 
free to ask any questions you have.  The app is in beta right now, it 
will go on www.supras.com when its done.

HTH - Anthony


/* add.php  -- part of the SOGI website media module
   writen by Knightrider version 1.0 9-24-02

   This script will alow a user to upload files into the database
*/

// lets include some files so that this crap will work
include 'database.inc';
include 'functions.inc';

// get some info from the config record so we know about upload settings
getConfig();
//echo "Diag mode:";
//print_r($HTTP_POST_VARS);

  if (empty($_POST['short']) || empty($_FILES['newfile']) || 
empty($_POST['gen']) || empty($_POST['category']))
  {
?>
http://www.w3.org/TR/html4/loose.dtd";>


  SOGI Media Module - Upload a file
	  


	
		
			
Media - Add a file
			
			 
			
			
		
	
	
	
	
	

	
	Upload an Image File
	Please fill in the details below to upload your file.
		Fields shown in red are mandatory.
	
		
			if (isset($_POST['submit']))
echo "You did not enter info into a required field!";
		?>
	




	
	   		Short description:
		
   	
			
	
	
		
			Long Description
		
		
			
		
	
		
			Uploaded by:
		
		
		
	
		
	   Select a Car Type
	   
	   
			Select One

			
	
		
			Select a media depiction
		
			
Select One

	 	
	   



   File:
   

	
  
	   
	   
	  


	
	
	
	

 	 
 		
  

Browse Media


  




  }
  else
  {


	$s="";	// set the var blank to add to query
 // Was a file uploaded?
	if (is_uploaded_file($_FILES['newfile']['tmp_name']))
	{			
			// open and read the uploaded file
			$file1=fopen($_FILES['newfile']['tmp_name'], "r");
			$file=fread($file1, $_FILES['newfile']['size']);

			// Escape special characters in the file
			$file=AddSlashes($file);
			
			$tmp=split('/',$_FILES['newfile']['type']);
			if ($tmp[0]=='image')
{
	$size = getimagesize($_FILES['newfile']['tmp_name']);
	$s=",width='{$size[0]}', height='{$size[1]}'";
}		
			
		}
	else
$file=NULL;

	$insertQuery = "INSERT INTO media_files SET
	 
	shortdesc='{$_POST['short']}',
		longdesc='{$_POST['longdesc']}',
		username='{$_POST['user']}',
		mimetype='{$_FILES['newfile']['type']}',
		filedata='{$file}',
		filesize='{$_FILES['newfile']['size']}',
		filename='{$_FILES['newfile']['name']}',
		uploaded=CURDATE(),
		category1='{$_POST['gen']}',
		category2='{$_POST['category']}'		
		";
	$insertQuery.=$s;
	// check for unknown file type, if it's unknown, automatically censor it.		
	$foo=split("/",$_FILES['newfile']['type']);
	if (AUTOCENSOR or !($foo[0]=="image" or $foo[0]=="video" or 
$foo[0]=="audio"))
		$insertQuery.=", censor='t'";
		
if ((doQuery($insertQuery)))
	 
	{
			//&& @ mysql_affected_rows() == 1)
			$lastid=mysql_insert_id();
			$statement="INSERT INTO media_stats SET id=$lastid";
			if ((doQuery($statement)))
{
				header("Location: receipt.php?status=T&file=$lastid");		
}
			else
{
	echo getError(); 

}
		}
 else
	 
	echo getError();
  }
?>


HTH - Anthony






Boa Constructor wrote:
I'm new to file uploads, however I managed to get it working.  Are you
copying the file after its been uploaded?  If not you need to do this as the
temp file is destroyed after the script has finished running so you need to
copy it if you wish to store it.  You also will have to chmod 777 to the
directory you wish to copy the file to.  It may help if we can see the
tutorial to try and find out exactly what you are doing.

I've been working from "Build Your Own Database Driven Website Using PHP &
MySQL" By Kevin Yank and its really helpful it covers file uploads.  I'm
also using "PHP and MySQL Web Development" by Luke Wellling and Laura
Thomson.  This covers file uploads also, infact I found it 

Re: [PHP-DB] upload data to MySql

2002-11-14 Thread Coert Metz
Hi

Never forget to include enctype="multipart/form-data" into your formtag

Bye

Coert

Jason Wong wrote:

On Thursday 14 November 2002 04:47, Seabird wrote:


Hi everyone,

I don't get my upload to work properly. It's a tutorial of the web, but it
doesn't function (unless I made a mistake). 


HOW doesn't it function?



Please help me...



You have to provide more information, like what you see when you submit the 
form and whether there were any error messages etc.

For starters, you should always set error reporting to MAX, and log errors to 
a file (if you're not displaying it to screen). These can be set in php.ini.

Next use print_r() on all your important variables at strategic places in your 
code so you can verify that they contain what you expect them to contain.



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




Re: [PHP-DB] upload data to MySql

2002-11-13 Thread Jason Wong
On Thursday 14 November 2002 04:47, Seabird wrote:
> Hi everyone,
>
> I don't get my upload to work properly. It's a tutorial of the web, but it
> doesn't function (unless I made a mistake). 

HOW doesn't it function?

> Please help me...

You have to provide more information, like what you see when you submit the 
form and whether there were any error messages etc.

For starters, you should always set error reporting to MAX, and log errors to 
a file (if you're not displaying it to screen). These can be set in php.ini.

Next use print_r() on all your important variables at strategic places in your 
code so you can verify that they contain what you expect them to contain.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
Term, holidays, term, holidays, till we leave school, and then work, work,
work till we die.
-- C.S. Lewis
*/


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




Re: [PHP-DB] upload data to MySql

2002-11-13 Thread Boa Constructor
I'm new to file uploads, however I managed to get it working.  Are you
copying the file after its been uploaded?  If not you need to do this as the
temp file is destroyed after the script has finished running so you need to
copy it if you wish to store it.  You also will have to chmod 777 to the
directory you wish to copy the file to.  It may help if we can see the
tutorial to try and find out exactly what you are doing.

I've been working from "Build Your Own Database Driven Website Using PHP &
MySQL" By Kevin Yank and its really helpful it covers file uploads.  I'm
also using "PHP and MySQL Web Development" by Luke Wellling and Laura
Thomson.  This covers file uploads also, infact I found it more helpful for
file uploads.


Hope this helps.

Cheers,

G :)

- Original Message -
From: "Seabird" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 13, 2002 8:47 PM
Subject: [PHP-DB] upload data to MySql


> Hi everyone,
>
> I don't get my upload to work properly. It's a tutorial of the web, but it
> doesn't function (unless I made a mistake). Please help me...
> I have a form passing on 5 fields (text for testing), name: year, make,
> model, price, picture and submit to PHP_SELF
>
>  if ($submit) {
>
> $db = mysql_connect("localhost","myname","mypassword");
>
> mysql_select_db("$test",$db);
> //DB Test for testing...
>
> $sql = "INSERT INTO test (year,make,model,price,picture) VALUES
> ('$year,$make,$model,$price,$picture')";
> //I created these columns in the table test
>
>
> echo "year: $year\n";
> echo "make: $make\n";
> echo "model: $model\n";
> echo "price: $price\n";
> echo "picture: $picture\n";
> }
>
> ?>
>
> I know I need globals on for this.
> Thanx for the help,
> Jacco
> --
> http://seabird.jmtech.ca
>
> Attitude is Everything!
> But Remember, Attitudes are Contagious!
> Is Yours worth Catching
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




[PHP-DB] upload data to MySql

2002-11-13 Thread Seabird
Hi everyone,

I don't get my upload to work properly. It's a tutorial of the web, but it
doesn't function (unless I made a mistake). Please help me...
I have a form passing on 5 fields (text for testing), name: year, make,
model, price, picture and submit to PHP_SELF

\n";
echo "make: $make\n";
echo "model: $model\n";
echo "price: $price\n";
echo "picture: $picture\n";
}

?>

I know I need globals on for this.
Thanx for the help,
Jacco
--
http://seabird.jmtech.ca

Attitude is Everything!
But Remember, Attitudes are Contagious!
Is Yours worth Catching



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




Re: [PHP-DB] upload script filename checking

2002-10-14 Thread Bas Jobsen

Op maandag 14 oktober 2002 15:41, schreef Michael Knauf/Niles:
> (because of the space)... so I want to replace any occurrence of " " with "
> _"
$filename=str_replace(' ','_',$filename);

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




[PHP-DB] upload script filename checking

2002-10-14 Thread Michael Knauf/Niles


Ok, so I've got a simple upload script... User uses form to select a file,
the file is then uploaded to a dir on the web server, and a link is
provided for the user to view the file.

Of course when the user uploads "my pic.jpg" the resulting link is broken
(because of the space)... so I want to replace any occurrence of " " with "
_"

Now I'm sure there are other nastys to worry about but I'm new to this any
suggestions on an easy way to make sure the file names are good?

Michael



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




Re: [PHP-DB] Upload csv file into mysql

2002-09-04 Thread Ignatius Reilly

You have to create your CSV by escaping the real data commas (eg
"1\,250\,260") when creating your CSV file - \ usually works, but you can
choose sth else if you have "\" actual data characters (usually not
recommended!).

and add
ESCAPED BY "\" to your LOAD statement

HTH

Ignatius

- Original Message -
From: "Karel Pøíbramský" <[EMAIL PROTECTED]>
To: "Ignatius Reilly" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
"Dr. Indera" <[EMAIL PROTECTED]>
Sent: Wednesday, September 04, 2002 10:33 AM
Subject: RE: [PHP-DB] Upload csv file into mysql


> Hi this is very helpful to me
>
> what if i have TABLE (id_item, rate1, rate2, rate3, rate4)
>
> and
>
> CSV file like foll
>
> id_item,rate1,rate2
> 1,250,260
> 2,270,280
> 5,290,290
>
> ?
>
> thx kaja
>
>
>
> S prátelským pozdravem
> Karel Príbramský
> AbiaNet, s.r.o.-www.abianet.cz---
>
>
> -Original Message-----
> From: Ignatius Reilly [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 04, 2002 9:51 AM
> To: [EMAIL PROTECTED]; Dr. Indera
> Subject: Re: [PHP-DB] Upload csv file into mysql
>
>
> Hi Dr,
>
> try:
>
> LOAD DATA INFILE "myfile.csv" INTO TABLE mytable
> FIELDS TERMINATED BY ","
> LINES TERMINATED BY "\r\n" ;
>
> of course, the structure of your CSV file must match exactly that of your
> table.
>
> hth
>
> - Original Message -
> From: "Dr. Indera" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, September 04, 2002 6:20 AM
> Subject: [PHP-DB] Upload csv file into mysql
>
>
> > Hello,
> >
> > Is there a way to upload data in a csv file into a mysql table?
> >
> > Thanks
> > Indera
> >
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




RE: [PHP-DB] Upload csv file into mysql

2002-09-04 Thread Karel

Hi this was very helpful to me, just now trying that

what if i have TABLE (id_item, rate1, rate2, rate3, rate4)

and

CSV file like foll

id_item,rate1,rate2
1,250,260
2,270,280
5,290,290

and what exactly mean \r in a TERMINATED BY?

thx kaja



S prátelským pozdravem
Karel Príbramský
AbiaNet, s.r.o.-www.abianet.cz---


-Original Message-
From: Ignatius Reilly [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 04, 2002 9:51 AM
To: [EMAIL PROTECTED]; Dr. Indera
Subject: Re: [PHP-DB] Upload csv file into mysql


Hi Dr,

try:

LOAD DATA INFILE "myfile.csv" INTO TABLE mytable
FIELDS TERMINATED BY ","
LINES TERMINATED BY "\r\n" ;

of course, the structure of your CSV file must match exactly that of your
table.

hth

- Original Message -
From: "Dr. Indera" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 04, 2002 6:20 AM
Subject: [PHP-DB] Upload csv file into mysql


> Hello,
>
> Is there a way to upload data in a csv file into a mysql table?
>
> Thanks
> Indera
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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


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




Re: [PHP-DB] Upload csv file into mysql

2002-09-04 Thread Ignatius Reilly

Hi Dr,

try:

LOAD DATA INFILE "myfile.csv" INTO TABLE mytable
FIELDS TERMINATED BY ","
LINES TERMINATED BY "\r\n" ;

of course, the structure of your CSV file must match exactly that of your
table.

hth

- Original Message -
From: "Dr. Indera" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 04, 2002 6:20 AM
Subject: [PHP-DB] Upload csv file into mysql


> Hello,
>
> Is there a way to upload data in a csv file into a mysql table?
>
> Thanks
> Indera
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




RE: [PHP-DB] Upload csv file into mysql

2002-09-04 Thread rhelms

Hi Dr. Indera, 

> 
> Is there a way to upload data in a csv file into a mysql table?

Try phpMyadmin.

Regards,
Ruprecht

---
Ruprecht Helms  -   IT-Service und Softwareentwicklung

Homepage: http://www.rheyn.de
email: [EMAIL PROTECTED]
=
E-Mail: Ruprecht Helms <[EMAIL PROTECTED]
Date: 04-Sep-02
Time: 10:10:56

This message was sent by XFMail
---

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




RE: [PHP-DB] Upload csv file into mysql

2002-09-03 Thread Beau Lebens

try phpMyAdmin - nice and easy, although i'm pretty sure there is a direct
command line.


// -Original Message-
// From: Dr. Indera [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 4 September 2002 12:21 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Upload csv file into mysql
// 
// 
// Hello,
// 
// Is there a way to upload data in a csv file into a mysql table?
// 
// Thanks
// Indera
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




[PHP-DB] Upload csv file into mysql

2002-09-03 Thread Dr. Indera

Hello,

Is there a way to upload data in a csv file into a mysql table?

Thanks
Indera



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




Re: [PHP-DB]upload image

2002-05-17 Thread Gerardo Morales

Nikolay


We have a frebsd server and the path i use to upload files (in this case 
images) is
$the_path = "/usr/local/etc/httpd/htdocs/site/images";
and it works fine.

I found a good code in phpbuilder.com



Nikolay Valentinov wrote:

> i have problem with image upload on freeBSD server.
> My question is:
> what must be address, where to upload file?
> i use "$uploadpath = $DOCUMENT_ROOT.'/xxx/photos/'"
> this works on Apache/Win98. Where is the problem?
> excuse me for my english :)
> Thanx!
> 
> 


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




[PHP-DB]upload image

2002-05-17 Thread Nikolay Valentinov

i have problem with image upload on freeBSD server.
My question is:
what must be address, where to upload file?
i use "$uploadpath = $DOCUMENT_ROOT.'/xxx/photos/'"
this works on Apache/Win98. Where is the problem?
excuse me for my english :)
Thanx!


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




RE: [PHP-DB] Upload Multiple Images

2002-04-11 Thread Beau Lebens

brandon,
you can only ever upload 1 file per "file" input box, but you can have more
than one of these input fields per form. you might have something like





that way when you are processing (assuming PHP4+) you can use something like

$HTTP_POST_FILES["file2"]["name"]

blah blah

hope that helps.

you will have to check, but i think the MAX_FILESIZE and post_max_filesize
or (whatever they are) variables apply to the *whole* form, so if your
MAX_FILESIZE var is set to 2meg, and you have 3 files uploading, then their
total must not exceed 3meg (i think)

HTH

Beau

// -Original Message-
// From: Brandon Paul [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 12 April 2002 6:06 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Upload Multiple Images
// 
// 
// Hi all...kinda new to PHP and MySQL...anyhow, I have created 
// the following
// table:
// 
// CREATE TABLE images (
//   id smallint(6) NOT NULL auto_increment,
//   image_title varchar(75) default NULL,
//   image_src varchar(150) default NULL,
//   PRIMARY KEY (id)
// ) TYPE=MyISAM;
// 
// I have also created a form that allows me to upload one 
// image at a time, but
// I would like to be able to upload SEVERAL images at once.  
// Directory for
// images is:
// 
// ./_images/(filenames)
// 
// There are also some subdirectories.  What can I do to make 
// it so that I can
// upload all of the images in a directory (or at least more 
// than one) without
// having to type each one in and submit it?
// 
// Your help would be very much appreciated!
// 
// Thanks,
// 
// Brandon Paul
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




[PHP-DB] Upload Multiple Images

2002-04-11 Thread Brandon Paul

Hi all...kinda new to PHP and MySQL...anyhow, I have created the following
table:

CREATE TABLE images (
  id smallint(6) NOT NULL auto_increment,
  image_title varchar(75) default NULL,
  image_src varchar(150) default NULL,
  PRIMARY KEY (id)
) TYPE=MyISAM;

I have also created a form that allows me to upload one image at a time, but
I would like to be able to upload SEVERAL images at once.  Directory for
images is:

./_images/(filenames)

There are also some subdirectories.  What can I do to make it so that I can
upload all of the images in a directory (or at least more than one) without
having to type each one in and submit it?

Your help would be very much appreciated!

Thanks,

Brandon Paul



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




Re[2]: [PHP-DB] Upload

2001-11-16 Thread Lilian Salazar


well, thank you very much to all by the aid and the advice!!
I am going to see that it happens

-- 
Saludos,
 Lilianmailto:[EMAIL PROTECTED]

matt> always make sure you restrict what can be uploaded though! only allow file
matt> extensions that you know are safe! otherwise people might do nasty things to
matt> your server!

matt> -Original Message-
matt> From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]]
matt> Sent: 16 November 2001 16:29
matt> To: 'Lilian Salazar'; [EMAIL PROTECTED]
matt> Subject: RE: [PHP-DB] Upload


matt> Hola Lilian,
matt> You might want to check http://phpclasses.upperdesign.com and search for
matt> "upload."

matt> - BUT -

matt> I have found it much easier and simpler to just to use my own code when
matt> doing uploads. It is really simple, since most of the work is done by the
matt> browser and the server programs. To add an upload function just create 2
matt> pages:

matt> ---
matt> page1.html  (Can be located anywhere, even on your desktop)
matt> http://www.mysite.com/page2.php";
METHOD="POST">>
matt> 
matt> 
matt> 
matt> ---


matt> ---
matt> page2.php   (Should be at http://www.mysite.com/page2.php)
matt>  copy($NewUpload, "/directory/to/put/uploaded/file/into/" . $NewUpload_name);
?>>
matt> ---

matt> - Jonathan

matt> -Original Message-
matt> From: Lilian Salazar [mailto:[EMAIL PROTECTED]]
matt> Sent: Friday, November 16, 2001 8:09 AM
matt> To: [EMAIL PROTECTED]
matt> Subject: [PHP-DB] Upload


matt> Hi,

matt>   Exists some component that allows to do upload from archives to the
matt>   Web server? Where it could find it? Somebody knows?
matt>   The ideal would be that it served so much for Apache as for IIS. The
matt>   Database is Oracle 8i
matt>   Thank you very much.


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




RE: [PHP-DB] Upload

2001-11-16 Thread matt stewart

always make sure you restrict what can be uploaded though! only allow file
extensions that you know are safe! otherwise people might do nasty things to
your server!

-Original Message-
From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]]
Sent: 16 November 2001 16:29
To: 'Lilian Salazar'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Upload


Hola Lilian,
You might want to check http://phpclasses.upperdesign.com and search for
"upload."

- BUT -

I have found it much easier and simpler to just to use my own code when
doing uploads. It is really simple, since most of the work is done by the
browser and the server programs. To add an upload function just create 2
pages:

---
page1.html  (Can be located anywhere, even on your desktop)
http://www.mysite.com/page2.php";
METHOD="POST">



---


---
page2.php   (Should be at http://www.mysite.com/page2.php)

---

- Jonathan

-Original Message-
From: Lilian Salazar [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 8:09 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Upload


Hi,

  Exists some component that allows to do upload from archives to the
  Web server? Where it could find it? Somebody knows?
  The ideal would be that it served so much for Apache as for IIS. The
  Database is Oracle 8i
  Thank you very much.

-- 
Saludos,
 Lilian  mailto:[EMAIL PROTECTED]


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

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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

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




RE: [PHP-DB] Upload

2001-11-16 Thread Jonathan Hilgeman

Hola Lilian,
You might want to check http://phpclasses.upperdesign.com and search for
"upload."

- BUT -

I have found it much easier and simpler to just to use my own code when
doing uploads. It is really simple, since most of the work is done by the
browser and the server programs. To add an upload function just create 2
pages:

---
page1.html  (Can be located anywhere, even on your desktop)
http://www.mysite.com/page2.php";
METHOD="POST">



---


---
page2.php   (Should be at http://www.mysite.com/page2.php)

---

- Jonathan

-Original Message-
From: Lilian Salazar [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 8:09 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Upload


Hi,

  Exists some component that allows to do upload from archives to the
  Web server? Where it could find it? Somebody knows?
  The ideal would be that it served so much for Apache as for IIS. The
  Database is Oracle 8i
  Thank you very much.

-- 
Saludos,
 Lilian  mailto:[EMAIL PROTECTED]


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

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




[PHP-DB] Upload

2001-11-16 Thread Lilian Salazar

Hi,

  Exists some component that allows to do upload from archives to the
  Web server? Where it could find it? Somebody knows?
  The ideal would be that it served so much for Apache as for IIS. The
  Database is Oracle 8i
  Thank you very much.

-- 
Saludos,
 Lilian  mailto:[EMAIL PROTECTED]


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




Re: [PHP-DB] upload problem ...

2001-07-13 Thread comp.mail.sendmail

Could anyone send me the actual code for doing the files upload to
 a linux box with php. I know the form for the upload but not the php file
that
does the upload .
Thanks everyone.


"Steve Brett" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> many thanks i'll try that asap.
>
> Steve
>
> "Xsarus Internetdiensten" <[EMAIL PROTECTED]> wrote in message
> 002901c0fe68$48613d40$0201a8c0@xsarusxsarus2">news:002901c0fe68$48613d40$0201a8c0@xsarusxsarus2...
> > He!
> >
> > Don't use the function 'copy', but 'move_uploaded_file'.
> >
> > Ready...
> > Daniel Kieviet
> > Xsarus Internetdiensten
> > Holland
> > [EMAIL PROTECTED]
> >
> >
> > - Original Message -
> > From: "Andre P." <[EMAIL PROTECTED]>
> > To: "Steve Brett" <[EMAIL PROTECTED]>
> > Cc: "php-db@lists. php. net (E-mail)" <[EMAIL PROTECTED]>
> > Sent: Monday, June 25, 2001 6:17 AM
> > Subject: Re: [PHP-DB] upload problem ...
> >
> >
> > > Steve,
> > >
> > > When you use input type=file the web server uploads the file to a
> > > temporary directory which it must have write access to, i.e. the user
> > > that the httpd process is run as must have write access to /php/tmp.
> > >
> > > To my knowledge there is no way of allowing the httpd process to write
> > > to that directory using your ftp users/password. Bear in mind that you
> > > could change the temporary upload directory from /php/tmp to /tmp.
> > >
> > > do you have full access to you box or only an account?
> > >
> > > hope this helps
> > >
> > > ciao
> > > Andre.
> > >
> > > Steve Brett wrote:
> > >
> > > >hi,
> > > >
> > > >i have a site and need to write a script to upload / download files
so
> > the
> > > >database can be updated / backed up.
> > > >
> > > >i've tried setting up an  > > >machine but php gives an eror onthe server saying that the /php/tmp
dir
> > > >cannot be written to by, i assume, the nobody account within whihc
the
> > web
> > > >server runs.
> > > >
> > > >i need  to be bale to write to the httpd dir using php and then i can
> get
> > > >the db to import the files.
> > > >
> > > >i have an ftp username and password but don't know how to get php to
> pass
> > > >the authorisation the server. the site is already password protected
> just
> > > >using a table of username / passowrds.
> > > >
> > > >many thanks in advance
> > > >
> > > >Steve
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > > --
> > > PHP Database Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > >
> >
>
>



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




RE: [PHP-DB] upload problem ...

2001-07-13 Thread Darren Casey

> -Original Message-
> From: Steve Brett [mailto:[EMAIL PROTECTED]]
> Sent: 13 July 2001 11:05
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] upload problem ...
>
>
> many thanks i'll try that asap.

The directorys will still need the permissions set so anyone can read/write
to the directorys (Using chmod if using linux)

Darren


>
> Steve
>
> "Xsarus Internetdiensten" <[EMAIL PROTECTED]> wrote in message
> 002901c0fe68$48613d40$0201a8c0@xsarusxsarus2">news:002901c0fe68$48613d40$0201a8c0@xsarusxsarus2...
> > He!
> >
> > Don't use the function 'copy', but 'move_uploaded_file'.
> >
> > Ready...
> > Daniel Kieviet
> > Xsarus Internetdiensten
> > Holland
> > [EMAIL PROTECTED]
> >
> >
> > - Original Message -
> > From: "Andre P." <[EMAIL PROTECTED]>
> > To: "Steve Brett" <[EMAIL PROTECTED]>
> > Cc: "php-db@lists. php. net (E-mail)" <[EMAIL PROTECTED]>
> > Sent: Monday, June 25, 2001 6:17 AM
> > Subject: Re: [PHP-DB] upload problem ...
> >
> >
> > > Steve,
> > >
> > > When you use input type=file the web server uploads the file to a
> > > temporary directory which it must have write access to, i.e. the user
> > > that the httpd process is run as must have write access to /php/tmp.
> > >
> > > To my knowledge there is no way of allowing the httpd process to write
> > > to that directory using your ftp users/password. Bear in mind that you
> > > could change the temporary upload directory from /php/tmp to /tmp.
> > >
> > > do you have full access to you box or only an account?
> > >
> > > hope this helps
> > >
> > > ciao
> > > Andre.
> > >
> > > Steve Brett wrote:
> > >
> > > >hi,
> > > >
> > > >i have a site and need to write a script to upload /
> download files so
> > the
> > > >database can be updated / backed up.
> > > >
> > > >i've tried setting up an  fine on my
> > > >machine but php gives an eror onthe server saying that the
> /php/tmp dir
> > > >cannot be written to by, i assume, the nobody account within
> whihc the
> > web
> > > >server runs.
> > > >
> > > >i need  to be bale to write to the httpd dir using php and then i can
> get
> > > >the db to import the files.
> > > >
> > > >i have an ftp username and password but don't know how to get php to
> pass
> > > >the authorisation the server. the site is already password protected
> just
> > > >using a table of username / passowrds.
> > > >
> > > >many thanks in advance
> > > >
> > > >Steve
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > > --
> > > PHP Database Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> > >
> >
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




Re: [PHP-DB] upload problem ...

2001-07-13 Thread Steve Brett

many thanks i'll try that asap.

Steve

"Xsarus Internetdiensten" <[EMAIL PROTECTED]> wrote in message
002901c0fe68$48613d40$0201a8c0@xsarusxsarus2">news:002901c0fe68$48613d40$0201a8c0@xsarusxsarus2...
> He!
>
> Don't use the function 'copy', but 'move_uploaded_file'.
>
> Ready...
> Daniel Kieviet
> Xsarus Internetdiensten
> Holland
> [EMAIL PROTECTED]
>
>
> - Original Message -
> From: "Andre P." <[EMAIL PROTECTED]>
> To: "Steve Brett" <[EMAIL PROTECTED]>
> Cc: "php-db@lists. php. net (E-mail)" <[EMAIL PROTECTED]>
> Sent: Monday, June 25, 2001 6:17 AM
> Subject: Re: [PHP-DB] upload problem ...
>
>
> > Steve,
> >
> > When you use input type=file the web server uploads the file to a
> > temporary directory which it must have write access to, i.e. the user
> > that the httpd process is run as must have write access to /php/tmp.
> >
> > To my knowledge there is no way of allowing the httpd process to write
> > to that directory using your ftp users/password. Bear in mind that you
> > could change the temporary upload directory from /php/tmp to /tmp.
> >
> > do you have full access to you box or only an account?
> >
> > hope this helps
> >
> > ciao
> > Andre.
> >
> > Steve Brett wrote:
> >
> > >hi,
> > >
> > >i have a site and need to write a script to upload / download files so
> the
> > >database can be updated / backed up.
> > >
> > >i've tried setting up an  > >machine but php gives an eror onthe server saying that the /php/tmp dir
> > >cannot be written to by, i assume, the nobody account within whihc the
> web
> > >server runs.
> > >
> > >i need  to be bale to write to the httpd dir using php and then i can
get
> > >the db to import the files.
> > >
> > >i have an ftp username and password but don't know how to get php to
pass
> > >the authorisation the server. the site is already password protected
just
> > >using a table of username / passowrds.
> > >
> > >many thanks in advance
> > >
> > >Steve
> > >
> > >
> > >
> > >
> >
> >
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>



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




[PHP-DB] UPLOAD

2001-07-06 Thread Enrico Comini

My problem is to browse a local pc (win) and upload a file in a remote
database.

There is a simple solution (js ie)?

Thanks,

Enrico




[PHP-DB] UPLOAD

2001-06-29 Thread Enrico Comini

My problem is to browse a local pc (win) and upload a file in a remote
database.
There is a simple solution ?
Thanks,
Enrico



Re: [PHP-DB] upload problem ...

2001-06-26 Thread Xsarus Internetdiensten

He!

Don't use the function 'copy', but 'move_uploaded_file'.

Ready...
Daniel Kieviet
Xsarus Internetdiensten
Holland
[EMAIL PROTECTED]


- Original Message -
From: "Andre P." <[EMAIL PROTECTED]>
To: "Steve Brett" <[EMAIL PROTECTED]>
Cc: "php-db@lists. php. net (E-mail)" <[EMAIL PROTECTED]>
Sent: Monday, June 25, 2001 6:17 AM
Subject: Re: [PHP-DB] upload problem ...


> Steve,
>
> When you use input type=file the web server uploads the file to a
> temporary directory which it must have write access to, i.e. the user
> that the httpd process is run as must have write access to /php/tmp.
>
> To my knowledge there is no way of allowing the httpd process to write
> to that directory using your ftp users/password. Bear in mind that you
> could change the temporary upload directory from /php/tmp to /tmp.
>
> do you have full access to you box or only an account?
>
> hope this helps
>
> ciao
> Andre.
>
> Steve Brett wrote:
>
> >hi,
> >
> >i have a site and need to write a script to upload / download files so
the
> >database can be updated / backed up.
> >
> >i've tried setting up an  >machine but php gives an eror onthe server saying that the /php/tmp dir
> >cannot be written to by, i assume, the nobody account within whihc the
web
> >server runs.
> >
> >i need  to be bale to write to the httpd dir using php and then i can get
> >the db to import the files.
> >
> >i have an ftp username and password but don't know how to get php to pass
> >the authorisation the server. the site is already password protected just
> >using a table of username / passowrds.
> >
> >many thanks in advance
> >
> >Steve
> >
> >
> >
> >
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




Re: [PHP-DB] upload problem ...

2001-06-25 Thread Andreas D. Landmark

At 25.06.2001 09:41, you wrote:

>hi,
>
>i have a site and need to write a script to upload / download files so the
>database can be updated / backed up.
>
>i've tried setting up an machine but php gives an eror onthe server saying that the /php/tmp dir
>cannot be written to by, i assume, the nobody account within whihc the web
>server runs.
>
>i need  to be bale to write to the httpd dir using php and then i can get
>the db to import the files.
>
>i have an ftp username and password but don't know how to get php to pass
>the authorisation the server. the site is already password protected just
>using a table of username / passowrds.

Rather than using PHP to do a setuid/setgid (which it can't do IIRC), change
the permissions on one of your catalogues to be writeable by the httpd-user,
and use that as your /tmp catalogue (/tmp is usually worldwriteable), however
be sure that your script cleans up after itself, otherwise you'd slowly 
fill up the
harddrive of the webserver (unless you write the same file evey time).



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




Re: [PHP-DB] upload problem ...

2001-06-25 Thread Andre P.

Steve,

When you use input type=file the web server uploads the file to a 
temporary directory which it must have write access to, i.e. the user 
that the httpd process is run as must have write access to /php/tmp.

To my knowledge there is no way of allowing the httpd process to write 
to that directory using your ftp users/password. Bear in mind that you 
could change the temporary upload directory from /php/tmp to /tmp.

do you have full access to you box or only an account?   

hope this helps

ciao
Andre.

Steve Brett wrote:

>hi,
>
>i have a site and need to write a script to upload / download files so the
>database can be updated / backed up.
>
>i've tried setting up an machine but php gives an eror onthe server saying that the /php/tmp dir
>cannot be written to by, i assume, the nobody account within whihc the web
>server runs.
>
>i need  to be bale to write to the httpd dir using php and then i can get
>the db to import the files.
>
>i have an ftp username and password but don't know how to get php to pass
>the authorisation the server. the site is already password protected just
>using a table of username / passowrds.
>
>many thanks in advance
>
>Steve
>
>
>
>




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