Developer-Community.com
Software => Rightload - Official Forums => Topic started by: d3p1 on June 07, 2010, 12:03:27 AM
-
Hey, can anyone help me with this?
I've made a simple HTTP uploader that redirects to the image when the upload is completed - how can I make rightload read this and pull the URL from it?
-
Does it actually redirect via a header redirect (Location: ...) or via HTML/Javascript? If it is a header, your only option right now would be to write a custom plugin that uploads the file using cURL and then interprets the headers somehow. You can find more details on that here: http://developer-community.com/forums/index.php/topic,104.0.html
If it is HTML, you can just create a new HTTP server for your uploader. The only slightly complicated thing would be to figure out what the regular expression for finding the new URL is. If you can't make it work, I could try to help you if you send me an email.
-
The image is displayed using the PHP HEADER function after the image is renamed with a secure hash.
-
If you wrote the script yourself, couldn't you just add an optional "rightload" parameter, that if set just "echo"s the final URL instead of redirecting to the image? Then you could setup Rightload to upload the picture with that parameter set and easily extract the URL.
-
I tried redirecting to a page that JUST echoed the URL of the image (thats all that was on the page, raw text) but I couldn't get RightLoad to find the URL after the upload.
-
What did you use as the "File Regular Expression"? If the page only contains the URL (no HTML) it should be something like ^(.*)$ with position of matching bracket = 1.
-
I feel amazingly stupid and I've got no idea why I couldn't get that working before. I did use that regex, must have done something else wrong though - I re-added all the other settings (form fields etc) and it just worked, first time.
Thanks for your help!
-
Great to hear, have fun with Rightload then! :)
-
Oh dear, just as I thought that everything was working fine - I found a pretty large problem.
The upload only retreieves the file name for the FIRST image uploaded, if I try uploading multiple images - I get this after upload:
http://www.domain.ext/files/
http://www.domain.ext/files/fb1d9bb7307851a201b540f071eeb4d4.png
Note: the files do upload to the server without problem.
Glitch in my code, not RightLoad - fixed.