Search found 17 matches

by JH14
Fri Oct 05, 2018 12:40 am
Forum: phpBB Custom Coding
Topic: Upload class failing to upload file.
Replies: 15
Views: 796

Re: Upload class failing to upload file.

Hi, After some tests, I deduced that the error was forming at the first clean_filename. The system started working when I changed it from 'real' to 'unique_ext'. Here is the code I have now and it works fine. $factory = $phpbb_container->get('files.factory'); $upload = $phpbb_container->get('files.u...
by JH14
Thu Oct 04, 2018 11:10 am
Forum: phpBB Custom Coding
Topic: Upload class failing to upload file.
Replies: 15
Views: 796

Re: Upload class failing to upload file.

Ger wrote:
Thu Oct 04, 2018 11:08 am
I'd start with

Code: Select all

var_dump($file->error);

To get an idea of what's wrong.
array(1) { [0]=> string(34) "ADDGAME_UPLOADGENERAL_UPLOAD_ERROR" }
by JH14
Thu Oct 04, 2018 11:01 am
Forum: phpBB Custom Coding
Topic: Upload class failing to upload file.
Replies: 15
Views: 796

Re: Upload class failing to upload file.

Thank you. This is what I now have: $factory = $phpbb_container->get('files.factory'); $upload = $phpbb_container->get('files.upload'); $filespec = $phpbb_container->get('files.filespec'); // We have a separate folder for each user. Let's make sure we have it. $full_upload_dir = 'images'; if (!is_di...
by JH14
Thu Oct 04, 2018 8:50 am
Forum: phpBB Custom Coding
Topic: Upload class failing to upload file.
Replies: 15
Views: 796

Re: Upload class failing to upload file.

It might be, but it's usually the last resort. If you know something in your DB should be an integer, than just cast it as such: $gameidnumber = (int) $gameidnumber; $gameimagenamefile = $db->sql_escape(); $query = "INSERT INTO indielix_gameimages (GameID, GameImage) VALUES ($gameidnumber, '$gameim...
by JH14
Wed Oct 03, 2018 9:48 am
Forum: phpBB Custom Coding
Topic: Upload class failing to upload file.
Replies: 15
Views: 796

Re: Upload class failing to upload file.

which part of it is insecure? SQL injection mainly. But you do get errors you say. Usually phpbb error reporting is quite clear. Can you post those errors? No sorry, I don't get any errors. All that happens is the page doesn't fully load after completion of the submit button. It loads the header wh...
by JH14
Wed Oct 03, 2018 2:45 am
Forum: phpBB Custom Coding
Topic: Upload class failing to upload file.
Replies: 15
Views: 796

Re: Upload class failing to upload file.

It looks like most of my previous observations still stand. NOFI, but it seems like you don't know the basics of phpBB (and have poor knowledge of writing secure PHP) so trying to help you with this fragment is kind of pointless. This should explain most of the file upload class. You can try to tak...
by JH14
Tue Oct 02, 2018 11:16 am
Forum: phpBB Custom Coding
Topic: Upload class failing to upload file.
Replies: 15
Views: 796

Re: Upload class failing to upload file.

I see several issues: - You can't use superglobals like $_POST and such - You check for $_POST['picupload'] that isn't in the form - request_var() is replaced by the $request class - You use your own $conn class instead of injecting $dbal and your query is subject to SQL injection - You switch only...
by JH14
Mon Sep 24, 2018 8:24 am
Forum: phpBB Custom Coding
Topic: Upload class failing to upload file.
Replies: 15
Views: 796

Upload class failing to upload file.

Hey, I've tried using the upload class to upload an image, however, the image doesn't get moved to the server or even starts to upload. I can't make sense of this: https://area51.phpbb.com/docs/dev/3.2.x/files/index.html# Can anybody help, please? $picupload = (isset($_POST['picupload'])) ? true : f...
by JH14
Thu Sep 20, 2018 1:52 am
Forum: phpBB Custom Coding
Topic: $request->file() help
Replies: 14
Views: 826

Re: $request->file() help

Hi all, I have tried using the upload class instead of the previous script I had used. No images are being uploaded still, but I'm not sure that I'm using the script correctly. Could somebody point out to me if I need to do any other additions to the script? $picupload = (isset($_POST['picupload']))...
by JH14
Sat Aug 11, 2018 2:52 pm
Forum: phpBB Custom Coding
Topic: $request->file() help
Replies: 14
Views: 826

Re: $request->file() help

Any more suggestions?
by JH14
Thu Aug 09, 2018 6:28 pm
Forum: phpBB Custom Coding
Topic: $request->file() help
Replies: 14
Views: 826

Re: $request->file() help

Yes.

Folder has 777 permissions
by JH14
Thu Aug 09, 2018 4:38 pm
Forum: phpBB Custom Coding
Topic: $request->file() help
Replies: 14
Views: 826

Re: $request->file() help

In that case you won't need $request = new \phpbb\request\request(); At all. So with that removed, I still get the error message showing that it failed to save the file. But when I echo out the contents of $gamefeaturedimage2 I get this array: ( [name] => 86179733.jpg [type] => image/jpeg [tmp_name...
by JH14
Thu Aug 09, 2018 2:51 pm
Forum: phpBB Custom Coding
Topic: $request->file() help
Replies: 14
Views: 826

Re: $request->file() help

That is still not the full script, as you never include any of the phpBB related files. You will need to properly set the phpBB required variables/constants and after that include at least common.php. In the header.php that is included I have this at the top: <?php define('IN_PHPBB', true); $phpbb_...
by JH14
Thu Aug 09, 2018 2:15 pm
Forum: phpBB Custom Coding
Topic: $request->file() help
Replies: 14
Views: 826

Re: $request->file() help

The first post usage is right. It is probarbly caused somewhere else. Can you post your whole script, instead of a snippet of it? <?php $request = new \phpbb\request\request(); $gameaccid = $user->data['user_id']; $userpaidtf = $user->data['user_indielix_paid']; include("dbconnectfile.php"); $stmt ...
by JH14
Thu Aug 09, 2018 1:44 pm
Forum: phpBB Custom Coding
Topic: $request->file() help
Replies: 14
Views: 826

Re: $request->file() help

I've tried
$request = new \phpbb\request\request();
and
$request = new forum\phpbb\request\request();
and
$request = new \forum\phpbb\request\request();

but none of them seem to work, i'm not getting any errors in the error_log

It does, however, fail to load the rest of the page

Go to advanced search