3.2 & 3.3 Extensions Database 3.2 / 3.3File Upload

<span class="qte-attr qte_32_33-qte">3.2.x & 3.3.x</span>
Previous topicNext topic
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

Topic Author
dmzx Online
Founder
Founder
Status: Online
User theme: Dark
Posts: 6485
Joined: Jan 13th, '14, 20:45
    Windows 10 Chrome

File Upload

Post by dmzx »

Extension Name: File Upload
Author: dmzx & martin

Extension Description:
This extension will add an upload system for files to your forum.
This will allow you to host your own files from your server rather than use a 3rd party.
Allowed extensions 'zip', 'rar'
Set permission for groups, default only admin group can upload files.

dmzx/File-Upload


- Code update.


- Rename "files" dir to "file-files"
- Code update for 3.3.x
- Changed code for ACP for deleting images.
- Change column filesize to BINT


- Dropped support of 3.1.x
- Added folder.


Added copy button by martin.
Twig update.
Update URL in files and copyright.


Code Update.

Screenshots:
Image

Image

Image

Image


Extension Download:
Download-link
File Upload v1.0.5
Installation:
  1. Download the latest release.
  2. Unzip the downloaded release, and change the name of the folder to `fileupload`.
  3. In the `ext` directory of your phpBB board, create a new directory named `dmzx` (if it does not already exist).
  4. Copy the `fileupload` folder to `/ext/dmzx/` if done correctly, you'll have the main extension class at
    (your forum root)/ext/dmzx/fileupload/composer.json
  5. Navigate in the ACP to `Customise -> Manage extensions`
  6. Look for `File Upload` under the Disabled Extensions list, and click its `Enable` link.

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

Puchahawa
Users
Users
Status: Offline
User theme: Dark
Posts: 193
Joined: Jun 20th, '15, 15:58
    Windows 7 Chrome

Re: File Upload

Post by Puchahawa »

Hi Dmzx, was wondering in what file you have it set for rar and zip files? Thinking of modifying this to allow members to upload mp3 and pdf files.

I have a bbcode that allows pdf files to be embedded in a post so they can be read / dl from the post. It needs a direct link to the file in order to work and this ext has that function.

The mp3's play using native html5 player but need to be uploaded again with a direct link for that to work.

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

martin
Admin
Admin
Status: Offline
User theme: Dark
Posts: 5123
Joined: Apr 6th, '14, 14:12
    Ubuntu Chrome

Re: File Upload

Post by martin »

Controller/fileupload.php

Code: Select all

protected $allowed_extensions = array(
		'zip',
		'rar',
	);
Image

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

Puchahawa
Users
Users
Status: Offline
User theme: Dark
Posts: 193
Joined: Jun 20th, '15, 15:58
    Windows 7 Chrome

Re: File Upload

Post by Puchahawa »

Thanks Martin :thumbup:

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

Puchahawa
Users
Users
Status: Offline
User theme: Dark
Posts: 193
Joined: Jun 20th, '15, 15:58
    Windows 7 Chrome

Re: File Upload

Post by Puchahawa »

Ok, I've managed to get the pdf files to load correctly but I'm having issues with the mp3 files. I select a file and click the submit. It says uploading 1% and climbs sometimes to 22% or 98% then goes back to waiting for localhost down at the very bottom where you would "normally see the upload / download info from the browser. There are no links provided and the file is not in the files folder of the ext. Any ideas? :wtf: Would it possibly matter what extension group the file is in in the boards attachments settings?

Running on localhost and phpbb 3.2.0

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

martin
Admin
Admin
Status: Offline
User theme: Dark
Posts: 5123
Joined: Apr 6th, '14, 14:12
    Ubuntu Chrome

Re: File Upload

Post by martin »

In short yes mp3 has to be enabled.

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

Puchahawa
Users
Users
Status: Offline
User theme: Dark
Posts: 193
Joined: Jun 20th, '15, 15:58
    Windows 7 Chrome

Re: File Upload

Post by Puchahawa »

Tried enabling mp3 in download, flash, and archive groups and no go. :thumbdown: :shock: Even cleared cache in case. :rolling: Didn't do anything for pdf and it worked ok. This mp3 thing has me stumped.

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

martin
Admin
Admin
Status: Offline
User theme: Dark
Posts: 5123
Joined: Apr 6th, '14, 14:12
    Ubuntu Chrome

Re: File Upload

Post by martin »

Mp3 has always been a funny thing there used to be an edit needed to play them and an order to enable the mp3 (note i said used too)

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

Puchahawa
Users
Users
Status: Offline
User theme: Dark
Posts: 193
Joined: Jun 20th, '15, 15:58
    Windows 7 Chrome

Re: File Upload

Post by Puchahawa »

Doing some more testing. tried using the attachment settings of the board to see if there was a issue with it enabling mp3 or not. Uploaded fine and it downloads fine. I'm able to use the mp3 player bbcode by going into my ucp and getting the direct link to the file which is what I have set up on my live (3.1.10) board now. Try to upload it with the file upload ext and nada. went into the ext controller/fileupload.php file and looked at the array setting. It had mp3 so I changed it to MP3 (and purged cache) to see if it made a difference and :thumbdown:

I know the extension is working because it uploaded the pdf file just fine. :wtf:

EDIT: I did add an edited version of the posting_editor_submit_ button.html file from the image upload ext. I've tried it and the link in the navbar same result.

EDIT 2: The one thing I notice on the image upload popup that isn't on the file upload is the file upload does not say what files extensions are allowed. ??

Looked in the server php error log to see if there was any clue and this entry is there and it corresponds with when I tried to upload a file.

[27-Feb-2017 18:33:11 UTC] PHP Warning: POST Content-Length of 3879509 bytes exceeds the limit of 3145728 bytes in Unknown on line 0

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

Topic Author
dmzx Online
Founder
Founder
Status: Online
User theme: Dark
Posts: 6485
Joined: Jan 13th, '14, 20:45
    Windows 10 Chrome

Re: File Upload

Post by dmzx »

Puchahawa wrote: Feb 27th, '17, 18:14 Doing some more testing. tried using the attachment settings of the board to see if there was a issue with it enabling mp3 or not. Uploaded fine and it downloads fine. I'm able to use the mp3 player bbcode by going into my ucp and getting the direct link to the file which is what I have set up on my live (3.1.10) board now. Try to upload it with the file upload ext and nada. went into the ext controller/fileupload.php file and looked at the array setting. It had mp3 so I changed it to MP3 (and purged cache) to see if it made a difference and :thumbdown:

I know the extension is working because it uploaded the pdf file just fine. :wtf:

EDIT: I did add an edited version of the posting_editor_submit_ button.html file from the image upload ext. I've tried it and the link in the navbar same result.

EDIT 2: The one thing I notice on the image upload popup that isn't on the file upload is the file upload does not say what files extensions are allowed. ??

Looked in the server php error log to see if there was any clue and this entry is there and it corresponds with when I tried to upload a file.

[27-Feb-2017 18:33:11 UTC] PHP Warning: POST Content-Length of 3879509 bytes exceeds the limit of 3145728 bytes in Unknown on line 0
Works here when I add mp3
Can you zip your files and PM them to me?

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

martin
Admin
Admin
Status: Offline
User theme: Dark
Posts: 5123
Joined: Apr 6th, '14, 14:12
    Ubuntu Chrome

Re: File Upload

Post by martin »

PHP Warning: POST Content-Length of 3879509 bytes exceeds the limit of 3145728

File upload time out the entire mp3 file did not make it you would need to edit your php.ini if you have access to it.

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

Puchahawa
Users
Users
Status: Offline
User theme: Dark
Posts: 193
Joined: Jun 20th, '15, 15:58
    Windows 7 Chrome

Re: File Upload

Post by Puchahawa »

martin wrote: Feb 27th, '17, 19:05 PHP Warning: POST Content-Length of 3879509 bytes exceeds the limit of 3145728

File upload time out the entire mp3 file did not make it you would need to edit your php.ini if you have access to it.
Shouldn't that happen using the boards attachment feature too if that were the case? :wtf: That error only shows up when I try to use the file upload ext.

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

Puchahawa
Users
Users
Status: Offline
User theme: Dark
Posts: 193
Joined: Jun 20th, '15, 15:58
    Windows 7 Chrome

Re: File Upload

Post by Puchahawa »

dmzx wrote: Feb 27th, '17, 18:50
Works here when I add mp3
Can you zip your files and PM them to me?
Sent

EDIT: Don't know if it matters but I'm running php 5.5.12 and apache 2.4.9 on wampserver
Last edited by Puchahawa on Feb 27th, '17, 19:32, edited 1 time in total.

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

Topic Author
dmzx Online
Founder
Founder
Status: Online
User theme: Dark
Posts: 6485
Joined: Jan 13th, '14, 20:45
    Windows 10 Chrome

Re: File Upload

Post by dmzx »

Puchahawa wrote: Feb 27th, '17, 19:27
martin wrote: Feb 27th, '17, 19:05 PHP Warning: POST Content-Length of 3879509 bytes exceeds the limit of 3145728

File upload time out the entire mp3 file did not make it you would need to edit your php.ini if you have access to it.
Shouldn't that happen using the boards attachment feature too if that were the case? :wtf: That error only shows up when I try to use the file upload ext.
Your file (PM) works fine on my test site.
I can upload mp3 with it.

What are the values of post_max_size and max_execution_time in your PHP information?

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Template.php on line 359: Array to string conversion
Array

martin
Admin
Admin
Status: Offline
User theme: Dark
Posts: 5123
Joined: Apr 6th, '14, 14:12
    Ubuntu Chrome

Re: File Upload

Post by martin »

Prob 30 seconds and thats not enough.

Previous topicNext topic