View Issue Details

IDProjectCategoryView StatusLast Update
0017162mantisbtdb mssqlpublic2023-05-04 16:23
ReporterSamCPP Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
PlatformMicrosoftOSWindowsOS VersionWin7 x64
Product Version1.2.17 
Summary0017162: Downloading attachment doesn't work
Description

Using MSSQL database, uploading a PNG attachment with files set to save on database, the file appears to be stored in binary in the DB correctly.

However on download, a hex encoded string is stored in the output file with leading "0x".

Steps To Reproduce
  1. Upload PNG to an issue.
  2. Right-click on link and save link as and save to local.
  3. Try to open downloaded file.
TagsNo tags attached.

Activities

SamCPP

SamCPP

2014-04-06 06:50

reporter   ~0039831

Correction to issue report. Can confirm the file is actually stored in the database incorrectly rather than the download saving incorrectly. Can't seem to be able to edit the issue description to correct this.

SamCPP

SamCPP

2014-04-06 07:09

reporter   ~0039833

After altering the 'content' column to varbinary(max), on MSSQL2008+, this should work to correct the DB data then the attachments should download correctly.

UPDATE [mantis_bug_file_table]
SET content = CASE WHEN SUBSTRING(CONVERT(VARCHAR, content), 1, 2) = '0x'
THEN CONVERT(VARBINARY(MAX), CONVERT(VARCHAR(MAX), content), 1)
ELSE content END

grangeway

grangeway

2014-04-06 07:12

reporter   ~0039834

Sam,

At the moment, mssql support is broken - I use mssql support at work.

We are hoping to get the DB layer replaced over next month to provide support for oracle/mssql/pgsql, and test it properly

Marking this as suspended for now

grangeway

grangeway

2014-05-16 15:00

reporter   ~0040334

MantisBT currently supports Mysql and has support for other database engines.

The support for other databases is known to be problematic.

Having implemented the current database layer into Mantis 10 years ago, I'm currently working on replacing the current layer.

If you are interested in using Mantis with non-mysql databases - for example, Oracle, PGSQL or MSSQL, and would be willing to help out testing the new database layer, please drop me an email at paul@mantisforge.org

In the meantime, I'd advise running Mantis with Mysql Only to avoid issues.

Thanks
Paul

dregad

dregad

2023-04-22 10:47

developer   ~0067690

We are resolving this issue as "no change required", because it was reported against an old version of MantisBT which is no longer supported.

There have been many improvements to MSSQL support in 1.3 and 2.x releases.

We recommend that you upgrade to the latest stable version [1]; if after doing so the problem still exists, do not hesitate to reopen the issue.

[1] http://www.mantisbt.org/download.php