Showing posts with label image. Show all posts
Showing posts with label image. Show all posts

Friday, March 23, 2012

multiple image uploads......

I've got a form and little script to upload a image which works fine.

<form......>
<input type=file name=file size=30>
</form>

$updir = "/home/myserver/public_html/casa/images";
@.copy($file, "$updir/$file_name") or die("The file you are trying to upload couldn't be copied to the server");

But when I change the form to upload multiple files and change the script to loop throught the array $file[] I get the 'or die' message "The file you are trying to upload couldn't be copied to the server"

<form......>
<input type=file name=file[] size=30>
<input type=file name=file[] size=30>
</form>

$file_count = count($file);
$i = 1;
while($i <= $file_count ){
$updir = "/home/myserver/public_html/casa/images";
@.copy($file, "$updir/$file_name") or die("The file you are trying to upload couldn't be copied to the server");
$i++
}

Any body see what I'm doing wronge here?

Thanks in advanceworked it out...

for ($i=0;$file[$i];$i++){
$updir = "/home/thinkdes/public_html/casa/images/property";
@.copy($file[$i], "$updir/$file_name[$i]") or die("The file $file_name[$i] couldn't be copied to the server");
}|||Can you post the full working code?

Multiple Image Load

How can I upload several pictures at once to use in a SQL Report? There are
over 6,000 pictures that I need available for a form letter that will include
a picture of the product referenced in the letter.
If I can load all of them at once into the project and reference them by
name connected from a stored procedure to the name of the picture, that would
be fine.
Someone on another board it was suggested I store the source in a SQL
database, but it hasn't worked when I try it that way.> Someone on another board it was suggested I store the source in a SQL
> database, but it hasn't worked when I try it that way.
Do you mean the you are storing OLE images in a SQL Database - and if you
view them say with Microsoft Access from the SQL table - you can see the
image ok, but when you try to put these images in a Reporting Services
Report you can't see them ?
If this is the case then you need to strip the first 105 chars from the
image to remove the OLE Header when trying to view the image in Reporting
Services.
We deal with this on pages 364 - 365 in the "Hitchhiker's Guide to SQL
Server 2000 Reporting Services"
What I would say though is that you may be better off hosting the images on
an IIS server and referencing the URL in the database, rather than storing
image blob data in a SQL Server 2000 database.
Peter Blackburn
Hitchhiker's Guide to SQL Server 2000 Reporting Services
http://www.sqlreportingservices.net
"UNOTech" <UNOTech@.discussions.microsoft.com> wrote in message
news:3482251C-7006-4A22-81C0-404CA456476B@.microsoft.com...
> How can I upload several pictures at once to use in a SQL Report? There
> are
> over 6,000 pictures that I need available for a form letter that will
> include
> a picture of the product referenced in the letter.
> If I can load all of them at once into the project and reference them by
> name connected from a stored procedure to the name of the picture, that
> would
> be fine.
> Someone on another board it was suggested I store the source in a SQL
> database, but it hasn't worked when I try it that way.