The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
upload files not working
I am creating a custom page on my vBulletin installation. The page will allow users to upload files. I am using the vBulletin system for the same. The code that i used for the same is given below. I get this error when i try to upload any file
Code:
Warning: move_uploaded_file(Uploads/index.html ): failed to open stream: No such file or directory in /usr/local/share/doc/vhost/mydomain.org/httpdocs/screen/index.php on line 84 Warning: move_uploaded_file(): Unable to move '/users/mydomain.org/tmp/phpsj0NMr' to 'Uploads/index.html ' in /usr/local/share/doc/vhost/mydomain.org/httpdocs/screen/index.php on line 84 Code:
if ($_REQUEST["do"] != "") { $vbulletin->input->clean_array_gpc('f', array( 'attachfile' => TYPE_FILE )); $target_path = "Uploads/"; $filename = $vbulletin->GPC['attachfile']['name']; $target_path = $target_path . $filename; if (move_uploaded_file($vbulletin->GPC['attachfile']['tmp_name'], $target_path)) { //Yay! File Upload was successful echo "File upload successful"; } Thanks in advance. There is a upload class in vBulletin. Is that of some help? I have to use the interface to upload pdf files of upto 2 Mb. |
#2
|
|||
|
|||
The error is saying that the Uploads directory is not in or writable to the screen directory. Try changing $target_path to the full server path and make sure the Uploads directory is writable.
|
#3
|
|||
|
|||
Thanks. The problem was with the target address. Specifying the complete path worked.
You rock!!! |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|