This topic is locked

Problems with file downloads in latest version

1/17/2022 10:25:24 PM
PHPRunner General questions
G
gtothill author

I seem to be having problems with the file upload and download from my application, using the latest PHPR version. I have a fairly complex setup and so its not beyond the bounds of probability that it is the setup on Nginx that is the issue. Still, I was hoping that someone might be able to spot the issue here.

Expected behaviour:
I have configured the application to save files in the local filing system, in a sub directory (attachments) of the root. The app is configured to use a mediumtext field in MySQL to store the attached file details.

As background - the server is Nginx with PHP 7.4.23-fpm on a docker stack. The application, in every other regard, works fine on the platform.

File uploads work fine - all the allowed file types (as set in phpRunner gui) upload fine - and the files are created in the attachments folder with an appended hash that uniquely identifies the file.

I notice two things. Firstly that clicking on the uploaded file in the EDIT screen downloads the associated icon and not the file. In the VIEW screen I get a blank screen with the single message 'access denied'.

Here is an example of the string stored in the MySQL when the file main.pdf is uploaded.

[{"name":"attachments\/main_c5znxjmh.pdf","usrName":"main.pdf","size":3206955,"type":"application\/pdf","searchStr":"main.pdf,!:sStrEnd"}]

I dont know how the code stores the attachment details but this seems likely to be an error. Im assuming that the usrName variable should store the username of the person who uploaded the file - not the file name again.

I wonder if this is the cause of the errors that I am seeing? Obviously Im happy to provide any further information as necessary.

Thanks in advance for any help!

Regards,

Geoff.

Sergey Kornilov admin 1/19/2022

usrName is the name of the file that will be displayed for the end user, as opposed to the physical name of the file on the hard drive.

If something doesn't work as expected you need to post your project to Demo Account and contact support directly.