Issue with ConcreteCMS 9.1.3 download_file

Hello ConcreteCMS community,

Looking for a little developer help here as I think I may be running into a bug with ConcreteCMS v9.1.3.

In particular I’m getting an error saying “Invalid File” on my download_file URL for files that I’ve uploaded for download. (they are restricted to registered users) Also the very URL string for the file download seems different than previously uploaded files. (Previously uploaded downloads were in an older version of Concrete)

Here’s an example download URL link for a file between old and new Concrete versions. Anyone have any idea what might be going on here? Looks like the file ID is stored differently on the file download URL’s or something?
New Download URL: website.com/download_file/7e9a0113-a0b8-42ac-8c26-6479f9faea38/202/8979
Old Download URL: website.com/download_file/5003/202/1437

Thanks so much for the assist!

  • Jordan Santaga

@jsantaga look here - should help (15:39)

Hello Ampersand, Thanks for the help! I’m aware of these features and that’s exactly what we’re using the download tracking URL. The question is why it’s not working and giving me the ‘invalid file’ error. Didn’t see any reason off the top of my head that would trigger the error, especially because other file downloads work.

If it’s worth mentioning, I’m using the file version ‘getDownloadURL()’ function to create the URL for downloading these mentioned files, not sure if that is related. Thanks again!

that functionality used to work with the file ID. The problem with that is you could try random numbers and you’d hit all the files you wanted.
So now it uses the file UUID which is that much longer random string with letters and numbers which protects the file information.

If you’re using the content block for instance it should work just fine. If you’re using third party stuff they might still be doing it the old way.

1 Like

Thanks SO much for this mnakalay. So any idea why that UUID doesn’t appear to be working for actual file downloading?

I’m building a ‘downloads’ hyperlink based of of some files uploaded to an express entity. Here’s my PHP behind the scenes. The getDownloadURL() function looks to be providing the correct URL that matches the tracking URL in the file manager. Yet even when I visit the same URL from the file manager I get the ‘invalid file’ error.

<?php foreach ($model_details->downloads->getControls() as $control): ?>
	<td data-attribute="downloads:
        <?php echo $control->getAttributeKey()->getAttributeKeyHandle(); ?>">
	<?php $download = $model->getAttribute($control->getAttributeKey()); ?>
	<?php if (is_object($download)): ?>
	    <a href="<?php echo $download->getDownloadURL(); ?>/<?php echo $entry_id; ?>" data-download-type="<?php echo $control->getAttributeKey()->getAttributeKeyHandle(); ?>" title="<?php echo $download->getTitle(); ?>">
	        <img />
	    </a>
	<?php endif; ?>
    </td>
<?php endforeach; ?> 

Just for grins, here is a link to one of those files for my client. (shoot me a DM and I can pay you for your troubles diagnosing some of this with me)
https://qcp-corp.com/download_file/a2b69fb7-fa26-4e92-b272-727ec58b8cf8/459

Thanks again!

I just sent you a DM with some pointers for you to check. If that doesn’t work, let me know.