Jump to content
UBot Underground

uploading a random file


Recommended Posts

I have been trying to come up with a way to upload a random image file. What I have right now is

 

 

 

change file field($element offset(<id="photo[]">, 1), "{$random list item(%path)}2.jpg")

 

I have list %path that is C:\newfolder\images1\, C:\newfolder\images2\ etc in a list. The issue is when ubot places this string into the file field, the server kicks back a php error. So Im guessing that I am doing something wrong. What am I doing wrong?

Link to post
Share on other sites

You might want to try separating it out... for example, before you do the change file field, use a set command for a random list item... then put the #filename into file to use. Does that make sense? If you can just use a direct link to a file on your computer and it works, but the way you are doing it doesn't... then try another way... :rolleyes:

Link to post
Share on other sites

set(#pic, "{$random list item(%path)}1.jpg", "Global")

 

change file field($element offset(<id="photo[]">, 0), #pic)

 

 

gives me this error - it seems that the image path isnt assembled or that the site doesnt want to take it.

 

 

Fatal error: Uncaught exception 'ImagickException' with message 'Unable to read the file: /tmp/phpiaWmpV' in /var/www/html/functions/photo_md5.php:9 Stack trace: #0 /var/www/html/functions/photo_md5.php(9): Imagick->readimage('/tmp/phpiaWmpV') #1 /var/www/html/views/poststeps.php(142): photo_md5_store('/tmp/phpiaWmpV') #2 /var/www/html/headers/base.php(77): include_once('/var/www/html/v...') #3 /var/www/html/index.php(81): require('/var/www/html/h...') #4 {main} thrown in/var/www/html/functions/photo_md5.php on line 9

Link to post
Share on other sites

Can you try a different method when naming the files? When I need to upload random images I have them named image1.jpg, image2.jpg, etc. This works great because I usually have over 1000 images and then to upload them I just use change file field($element offset(<id="photo[]">, 1), "image{$random(1,1000).jpg"). This has worked for me on all the sites I have tried. I will check on that site now to see if it works - will let you know.

 

 

EDIT: Yup, this worked for me:

change file field(<id="photo[]">, "C:\\Users\\...\\image{$rand(1, 100)}.jpg")

Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...