Forums

PHP

This topic is locked

upload (Tim)

Posted 29 Nov 2001 17:51:25
1
has voted
29 Nov 2001 17:51:25 enquest enquest1 posted:
Tim I must say thank you for your help!

But with the upload...
Does you script only allow to upload one image a time. Or am I doing something wrong. You see I need to upload 5 images. With one I don't have problems with your script and instructions. But 2 or more always give errors. If I would be any more brave coder then I would join (open source) you to enhance your script.

Thanxs.

Replies

Replied 04 Dec 2001 13:07:06
04 Dec 2001 13:07:06 enquest enquest1 replied:
I need to upload more then one picture. Please somebody help. How do I go around this?

Replied 04 Dec 2001 13:14:40
04 Dec 2001 13:14:40 enquest enquest1 replied:
<img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>
Sorry for asking I know you do this for the open source mind...
When will the upload v2.0 be there?

Thanxs

Replied 05 Dec 2001 12:21:49
05 Dec 2001 12:21:49 Tim Green replied:
Version 2 will be a little while off. However, I will correct you on one point. My extensions are not Open Source, or GPL. Enhancement of my scripts for personal use is fine, but any distribution of these enhancements is a breach of copyright.

Version 2 will be a commercial extension, and will be able to handle multiple uploads amongst other things.

To achieve multiple uploads in the current version of the PHP Upload then you will need to siginificantly modify the code. There isn't a simple way to do it I'm afraid.

Tim Green

Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>

Edited by - rawveg on 05 Dec 2001 12:24:56
Replied 05 Dec 2001 12:26:54
05 Dec 2001 12:26:54 enquest enquest1 replied:
Thats ok,
I am willing to pay for your work!
However I am on a low budget..
Maybe once I start making money with these extensions, then its fair to pay a related price for your work and support.

But do you have in the current time a sol. for the more upload pictures at once?

Replied 05 Dec 2001 12:38:26
05 Dec 2001 12:38:26 Tim Green replied:
As I said in my last post, this would require some significant haqnd coding at the moment.

A slightly ugly solution would be to use a popup window to handle the upload, but this would require that the user clicks on a button/link the window would popup with a form and a file upload field. When the upload has been done, the window closes.

You could then repeat the same procedure as many times as you like.

Hope this helps

Tim Green

Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
Replied 08 Jul 2002 20:31:00
08 Jul 2002 20:31:00 dyna c replied:
Hello Tim

I have put 2 upload files on the same insert page - the file fields are called file and file1. The uploads are to different dirs.

I keep getting a parse error - can you tell me how to make this work

Regards

Replied 09 Jul 2002 09:37:45
09 Jul 2002 09:37:45 Tim Green replied:
As <b><u>clearly</u></b> stated in previous posts on this thread multiple uploads with the current PHP Upload extension are not possible without significant changes to the code itself.

Tim Green

Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
Replied 09 Jul 2002 09:49:34
09 Jul 2002 09:49:34 dyna c replied:
Thanks for the reply

Before I posted the question I searched the froum - but I understood the the other question as asking if one could ipload multiple files from the same upload. eg select more than one filr at a time in he file box.

Is there an easy solution or workround to inserting a new record that uses an upload I want to use a thumb and large image.

Also I may need to update the page
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
As <b><u>clearly</u></b> stated in previous posts on this thread multiple uploads with the current PHP Upload extension are not possible without significant changes to the code itself.

Tim Green

Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Replied 09 Jul 2002 10:36:46
09 Jul 2002 10:36:46 Julio Taylor replied:
hi!

the posts have repeatedly stated that PHP Upload only uploads *one* image per upload. It is designed to upload one file at a time. The best thing for you (if you realy want to upload 2 images in one page) is to either create an i-frame or layer and maybe insert another form in it for the second upload sequence. Failing that you could just do what most other people do (myself included), and simply use 2 differemt PHP pages to do it, separating the procesds into 2 further steps. You'll avoid yourself one hell of a headache if you just split the work into 2 sections.

The problem is that you might have problems inserting the 2nd image, because this extension, in my experience, behaves rather eccentrically when you are trying to update a record. The use of GET vars and Recordsets side-by-side usually ends up in tears and frustration. The best way to do it is to create a relational set of tables, linked by a common record ID and store the pics, thumbs and records in 3 separate tables. This will keep yur table sizes low, and also allow you to have unlimited images and thumbs per record, and also greater flexibility in the future, should you need/wish to modify the function/methods of the database.

hope it helped, etc.

------------------------
Poolio

MSN:

www.eliziumdesign.com
Replied 09 Jul 2002 21:29:04
09 Jul 2002 21:29:04 dyna c replied:
Thanks for the reply

But do not understand the solution presented.

If I have an insert page that creates a new record how do I use 2 pages to insert my thumb image and large image ?.

My problem is the insert will create a new record - so the second insert creates a new record.



Thanks in anticipation
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
hi!

the posts have repeatedly stated that PHP Upload only uploads *one* image per upload. It is designed to upload one file at a time. The best thing for you (if you realy want to upload 2 images in one page) is to either create an i-frame or layer and maybe insert another form in it for the second upload sequence. Failing that you could just do what most other people do (myself included), and simply use 2 differemt PHP pages to do it, separating the procesds into 2 further steps. You'll avoid yourself one hell of a headache if you just split the work into 2 sections.

The problem is that you might have problems inserting the 2nd image, because this extension, in my experience, behaves rather eccentrically when you are trying to update a record. The use of GET vars and Recordsets side-by-side usually ends up in tears and frustration. The best way to do it is to create a relational set of tables, linked by a common record ID and store the pics, thumbs and records in 3 separate tables. This will keep yur table sizes low, and also allow you to have unlimited images and thumbs per record, and also greater flexibility in the future, should you need/wish to modify the function/methods of the database.

hope it helped, etc.

------------------------
Poolio

MSN:

www.eliziumdesign.com
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Replied 10 Jul 2002 13:00:59
10 Jul 2002 13:00:59 Michael Guntenaar replied:
You can do pretty cool things with an combination of GD2.0 en PHP <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

And for the mulitple file uploads I use
Jupload (www.aspupload.com/jupload.html)

Just install it and modify your form to post to your PHP page

The uploaded files are put in an $HTTP_POST_FILES array

From that point use foreach() to loop through the files

<pre id=code><font face=courier size=2 id=code>
$fullImg = ImageCreateFromJPEG($IMG['tmp_name']);

$getal = imagesx($fullImg) / 500;
$new_w = imagesx($fullImg)/$getal;
$new_h = imagesy($fullImg)/$getal;
$fullOut= ImageCreateTrueColor($new_w,$new_h);
imagefill($fullOut, 0, 0, ImageColorAllocate($fullOut, 255, 255, 255));
imagecopyresampled($fullOut,$fullImg,0,0,0,0,$new_w,$new_h,ImageSX($fullImg),ImageSY($fullImg));

$thumb_path = ""../fulls/$stamp$IMG[ 'name']";

ImageJPEG($fullOut, $path);
</font id=code></pre id=code>

Repeat this code for the thumbs etc etc (but chance the width var) and the path var

Then insert the $***_path values in the DB and your done
<img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
My problem is the insert will create a new record - so the second insert creates a new record.
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Try to teach yourself some SQL an UPDATE query is pretty basic stuff



Edited by - mguntenaar on 10 Jul 2002 13:03:47

Edited by - mguntenaar on 10 Jul 2002 13:04:16

Reply to this topic