On Wed, 21 Feb 2018 12:16:14 GMT, Sönke Ludwig wrote:

The problem lies in DirEntry.name storing the full relative path of the image (e.g. "./public/uploads/foo.png"). Using img(src="uploads/#{std.path.baseName(f)}") instead should make it work, AFAICS.

Yeah, that worked.

But there's one more thing if you don't mind. When trying to make a struct with an image, i.e

struct Thing
{
 string title;
 string comment;
 ??? image; 
} 

I'm not sure what the proper type should be.

f.stringof

gives me

file

But doing

File file;

give me:

Error: function std.stdio.File.opAssign (File rhs) is not callable using argument types (FilePart*)

But when i try to use FilePart, errors happen regardless of compiler/version.

FilePart* file;

LDC 1.70:
DMD 2.078.0:

 Error: template std.conv.toImpl cannot deduce function from argument types !(FilePart*)(string)
 Error: template instance std.conv.to!(FilePart*).to!string error instantiating

and

FilePart file;

gives:

vibe-d\web\vibe\web\common.d(730,35): Error: cannot pass type Field as a function argument

vibe-d\web\vibe\web\common.d(730,35): Error: struct vibe.utils.dictionarylist.DictionaryList!(string, false, 12LU, false).DictionaryList member m_fields is not accessible

vibe-d\web\vibe\web\common.d(730,29): Error: template vibe.web.common.readFormParamRec cannot deduce function from argument types !()(HTTPServerRequest, int, string, bool, NestedNameStyle, ParamError)

vibe-d\web\vibe\web\common.d(689,21): vibe.web.common.readFormParamRec(T)(scope HTTPServerRequest req, ref T dst, string fieldname, bool required, NestedNameStyle style, ref ParamError err)

And around a dozen more in common.d