Closed Thread Icon

Topic awaiting preservation: multiple file uploads Pages that link to <a href="https://ozoneasylum.com/backlink?for=25293" title="Pages that link to Topic awaiting preservation: multiple file uploads" rel="nofollow" >Topic awaiting preservation: multiple file uploads\

 
Author Thread
EDDII
Bipolar (III) Inmate

From:
Insane since: May 2004

posted posted 03-19-2005 20:58

does anybody have any idea how i can make a good multiple file upload page cos at the moment if you upload any more than one at a time the page times out

Emperor
Maniac (V) Inmate

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 03-24-2005 05:48

EDDII: In PHP I assume?

Its doable (I've done it) but I'm unsure about this timing out business you mention. Is it Ok on one but it chokes on 2+?

This would suggest to me your script is wrong or you are trying to upload big files. If the latter there is no real fix I can think of doing it that way (you'd need to FTP it in or something).

Anyway if you could let us see what you are using and fill out a bit more info and we can go from there.

___________________
Emps

The Emperor dot org | Justice for Pat Richard | FAQs: Emperor | Site Reviews | Reception Room

if I went 'round saying I was an Emperor just because some moistened bint had lobbed a scimitar at me, they'd put me away!

EDDII
Bipolar (III) Inmate

From:
Insane since: May 2004

posted posted 03-25-2005 01:55

ok im just using

code:
$_FILES['file']


and the this is that i mae an image gallery and most of the image are about 700-500 ish and one of the first problems i was having it that with the basic input if u had like 20 images not only would you have to select them all individually but you would also have to have them all load at once so if it didnt do one it didnt do any and if pages take a lot of time to load generally browsers time out, but really what would be ideal would be if it loaded them 1 at a time then passed the next image onto a diferent page what i mean by that is that it would upload the first image as one page and pass the rest on and so on

Emperor
Maniac (V) Inmate

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 03-25-2005 03:07

You could load the file locations into a session and then have the page step through each one (pos. with a skip button) - that'd work.

___________________
Emps

The Emperor dot org | Justice for Pat Richard | FAQs: Emperor | Site Reviews | Reception Room

if I went 'round saying I was an Emperor just because some moistened bint had lobbed a scimitar at me, they'd put me away!

EDDII
Bipolar (III) Inmate

From:
Insane since: May 2004

posted posted 03-29-2005 01:27

ahh yes i thought about that but then i have no idea how to stop the second page you go to from loading them you see if you point a form to submit.php then submit.php will load the images before it displays anything
so you have any ideas about selecting more than one at a time either?

Nada`King
Bipolar (III) Inmate

From: United States
Insane since: Mar 2005

posted posted 03-29-2005 18:48

EDII: I'm not sure what your code looks like, so I'll just cover a few bases.
1. You can stream data at any size using fread(). Example: fread($datastream, 1024)
2. Make sure you shut down the stream at the end of the script or you will get a hang (of server or client)


I'm short on time so I just ripped this out of the PHP Manual:
http://docs.php.net/en/features.file-upload.html


code:
<?
/* PUT data comes in on the stdin stream */
$putdata = fopen("php://stdin", "r");

/* Open a file for writing */
$fp = fopen("myputfile.ext", "w");

/* Read the data 1 KB at a time
and write to the file */
while ($data = fread($putdata, 1024))
fwrite($fp, $data);

/* Close the streams */
fclose($fp);
fclose($putdata);
?>



code:
<!-- I am the form you use on the webpage -->

<form action="file-upload.php" method="post" enctype="multipart/form-data">
Send these files:<br />
<input name="userfile[]" type="file" /><br />
<input name="userfile[]" type="file" /><br />
<input type="submit" value="Send files" />
</form>



Let me know if I have been of any help, or if the problem persists.

« BackwardsOnwards »

Show Forum Drop Down Menu