oneano 8 Posted September 29, 2012 Report Share Posted September 29, 2012 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? Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted September 29, 2012 Report Share Posted September 29, 2012 site to test on? Quote Link to post Share on other sites
oneano 8 Posted September 29, 2012 Author Report Share Posted September 29, 2012 http://www.myproviderguide.com/page/poststeps.html Quote Link to post Share on other sites
Legend 181 Posted September 29, 2012 Report Share Posted September 29, 2012 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... Quote Link to post Share on other sites
oneano 8 Posted September 29, 2012 Author Report Share Posted September 29, 2012 Thanks Duane, I am still learning and understand ubot. Tips like yours are great and really keep me pushing the envelope. Quote Link to post Share on other sites
oneano 8 Posted September 29, 2012 Author Report Share Posted September 29, 2012 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 Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted September 29, 2012 Report Share Posted September 29, 2012 have you tried uploading the image manually on their site and does it work? thats php errors that pop up on there site, not really something ubot can solve if its a server side issue. what is the link to test on? Quote Link to post Share on other sites
oneano 8 Posted September 29, 2012 Author Report Share Posted September 29, 2012 I can seem to get manual files to work just fine. Haring a file upload command also works of course that isn't random. http://www.myproviderguide.com/page/poststeps.html Quote Link to post Share on other sites
illmill 87 Posted October 6, 2012 Report Share Posted October 6, 2012 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") Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.