Jump to content

Recommended Posts

I am very new to PHP so keep your hekp simple (like myself) please.  I have an application that I use for uploading up to 6 properties then resizing them - works great.  Now I need to deal with much larger uploads so I am looking for either a bulk upload solution or some way of pre-completing the input fields (like the value='cxcxcxc' on a normal text input) any idea

[code]

<?php

include('photostandards.inc');

include('photopages.inc');

session_start();

#$max_no_img=10; // Maximum number of images value to be set here

echo "<form method=post action=gallerydoit.php enctype='multipart/form-data'>";

echo "<table border='0' width='400' cellspacing='0' cellpadding='0' align=center>";

for($i=1; $i<=$max_no_img; $i++){

switch ($i) {

  case 1:

      echo "<tr><td>$px1 </td><td>";

      break;

  case 2:

      echo "<tr><td>$px2 </td><td>";

      break;

  case 3:

      echo "<tr><td>$px3 </td><td>";

      break;

case 4:

      echo "<tr><td>$px4 </td><td>";

      break;

case 5:

      echo "<tr><td>$px5 </td><td>";

      break;

case 6:

      echo "<tr><td>$px6 </td><td>";

      break;

}

 

echo"<input type=file name='images[]' class='bginput' size='30'></td></tr>"; #HERE - How do I pre-complete - value of each image $px5 px6 etc?

}

echo "<tr><td colspan=2 align=center><input type=submit value='Add Image'></td></tr>";

echo "</form> </table>";

?>

 

 

[/code]

Link to comment
https://forums.phpfreaks.com/topic/149274-file-upload-fill-in-the-input-field/
Share on other sites

You can't auto/pre complete a file element, its classed as a security risk.. it you could then using a few exploits could be you grab any file off of a clients pc..

 

Options:~ (goo but not easy)

Create an activeX or BHO that gets installed onto the clients browser,

Create a Java Applet that allows user to select files,

 

Or (simple option)

add simply add X number of file elements so they can upload more files at once.

 

ie

echo"<input type=file name='images[]' class='bginput' size='30'></td></tr>"; 
echo"<input type=file name='images[]' class='bginput' size='30'></td></tr>"; 
echo"<input type=file name='images[]' class='bginput' size='30'></td></tr>";
..

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.