![]() |
Attachment Upload by URL
/*================================================= =====================*\
|| Attachment Upload by URL || Author : Psionic Vision || Works on : vBulletin 3.0.7 Only \*================================================ ======================*/ There have been some requests for attachment upload by URL option... So here it is - my atttempt to create something like this. I am not sure that the way I did it is completely valid, but it does work. That is why I put it in beta releases. The code is fairly short, so it will not take more than one minute to install or remove it. What this does is, it allows a user to upload an attachment from an URL rather than directly from user's computer. Sometime it is very useful. Please test it out and comment and/or criticize. Thanks. Edit: A fix was posted, please see this post: https://vborg.vbsupport.ru/showpost....7&postcount=14 This fix is included into the new manual. |
a description of the tool please.. .title is not making any credit to your work.. ;)
|
I believe it allows you to attach a file from a url instead of uploading it.
|
jugo,
Exactly. |
In That Case:
/me installed faster than a fat chick heads to the buffet. Thanks Bro!!! |
Does this attach images using the [img] bbcode? Or does it add a new line to the attachment part with the option of a URL?
|
Yes, it adds a field for URL input next to the field for file input :)
Quote:
|
very sweet mod, should've been part of the product ages ago.
|
Not working. Error "Please select a file to attach using the "Browse..." button."
|
Then you did not install it correctly. What is your vB version?
|
Quote:
|
Quote:
|
Your problem is in the javascript in template that checks for a value in upload field.
|
Sorry, I forgot to include that into the instructions. Will update them in a minute.
The fix is as follows: In template 'newattachment', find: Code:
if (elm.type == 'file') Code:
if ((elm.type == 'file') || (elm.type == 'text')) |
from the looks of it this hack requires curl which is not a standard library, you should mention this in the first post;)
pretty cool though, i may look into it;) |
Quote:
This can be done much easier with fopen. I have not Installed this hack, or tested my file change.. It should work though. Replace the Code he gives in the install file with this. PHP Code:
|
screenshot please, just for looking ?
|
Quote:
|
Quote:
|
Can't get the fopen() code to work either.
|
Quote:
|
Can't tell as error has been turned off. I get a blank page, or nothing. I managed to upload only one url... from my site
|
Yeah...
1. The reason I used CURL library is safety. Originally, prior to installation of my hack, the code posted above would not work, as the is_uploaded_file function would not allow it. Right now, however, his code, would pose a security threat to your board, because it would tell the API that the file was uploaded by CURL and is safe, while that is not really true. Therefore, the alternate code of yours is completely impertinent to the hack and I would like you to remove it. Thanks. 2. The code works for my site, however I set it to time out after 25 seconds of no response. Now, what exactly is the problem? P.S. Please read here if you don't know why fopen is not safe: https://vborg.vbsupport.ru/showthread.php?t=80541 |
I kind of agree with Dark Visor. Someone posted a hack, if there is a problem, let him fix it. No need to hijack his thread. That only creates confusion. If you have a different idea, create your own thread.
|
hmmm...this seems interesting...so does it actually upload the file on the server?? that would save loads off red crosses...and is the original version working for all??
|
Quote:
|
Dude,,i dont get any error..but after i click upload..it just says uploading..then nothign happens...
|
There is a timeout after 25 seconds. And it works only if you have Curl installed...
|
Thanks.
|
I guess this could be moved to Final Releases?
|
It worked just fine for me...and i love it...time to place this puppy on the live boards!!!
|
how can i change time out from 25s to 1 minute of more?
|
Dude,,i dont get any error..but after i click upload..it just says uploading..then nothign happens... and i have alread installed curl
|
Quote:
Code:
if (elm.type == 'file') |
Quote:
It would be nice to have "upload by URL" on the same line as the entry box, though, since it is kind of confusing, but otherwise works great! |
quachvu,
I do not provide support for modified templates. yoyoyo, thanks :) Maybe I'll make it on one line. I'll see. |
its a original template and was not modified, and even i set up a fresh Vbulletin 307 forum and look in newattachment i just only can find this code in it
Quote:
|
Sorry, my bad.
You would need to replace PHP Code:
PHP Code:
|
Thank youn for this Hack but i?ve got one Problem:
If I want to attach any File by URL I get this Error Message: Quote:
cu logofreax |
I don't think it has anything to do with my hack...
|
All times are GMT. The time now is 10:12 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|