Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Uploading images with GDN_UploadImage
odannyc
New
Okay so I'm trying to use my postcontroller to upload an image and save the image path in a field on the database.
So far I have this on my post view: $this->Form->imageUpload('Image')
How do I get it so that my post controller saves this image to my file system then saves the path to a field (image) on my GDN_Discussion table?
0
Comments
Have you had a look at how the Image Upload plugin does it?
https://vanillaforums.org/addon/imageupload-plugin
If you are using advanced editor, all you do is drag the image into the box...
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Okay so I looked at the code and I'm stuck at this part:
$TmpImage = $UploadImage->ValidateUpload('image_file');
The 'image_file' should be whatever is in the form right?
So I tried this: $TmpImage = $UploadImage->ValidateUpload($this->Form->currentImage('image'));
And that didn't work.
Any suggestions?