21301 Posts in 5735 Topics by 2603 members
General Questions
SilverStripe Forums » General Questions » [SOLVED] SS3 Upload many files/images [SOLVED] Resize image if it's larger than a certain width
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | Next > | |
| Author | Topic: | 2586 Views |
-
Re: [SOLVED] SS3 Upload many files/images [SOLVED] Resize image if it's larger than a certain width

25 July 2012 at 1:27am
@Hattori thx for replay
I have still problem with attach, the same like @Liam
Sorry for bad English
-
Re: [SOLVED] SS3 Upload many files/images [SOLVED] Resize image if it's larger than a certain width

25 July 2012 at 1:54am
I did a quick test yesterday with 1 image and it uploaded to the custom folder I specified. That didn't seem to be the issue. The issue was not being able to edit or remove them like shown in the screenshot I posted.
This happens with or without setFolderName(); being called.
-
Re: [SOLVED] SS3 Upload many files/images [SOLVED] Resize image if it's larger than a certain width

25 July 2012 at 5:34am Last edited: 25 July 2012 5:50am
@Liam Thx for the correct
Never mind
-
Re: [SOLVED] SS3 Upload many files/images [SOLVED] Resize image if it's larger than a certain width

25 July 2012 at 5:48am
I think I got this working now. Using the many_many relationship instead of has_many as I got the path error bug as well.
Then I removed the $this->Images() from the UploadField and everything is working and I can now edit/remove images attached to pages.
I did find another bug I think in that setFolderName() can't take spaces. When I use 'FolderName' it doesn't create a folder with a space in it like I thought might, so I tried doing 'Folder Name' and while it creates the proper name with the directory being 'Folder-Name' uploads fail for some reason. URL looks correct but always 404.
-
Re: [SOLVED] SS3 Upload many files/images [SOLVED] Resize image if it's larger than a certain width

25 July 2012 at 5:48am
@Craftnet The other topic is setup to use the name screenshot, your code isn't obviously. The names of the field have to match the db stuff.
Keep your latest code and switch the has_many to a many_many and then run dev/build and see what happens.
-
Re: [SOLVED] SS3 Upload many files/images [SOLVED] Resize image if it's larger than a certain width

25 July 2012 at 6:01am
finally
Thanks @thi3r
Thanks @Hattori
Thanks @Liam for the final solution -
Re: [SOLVED] SS3 Upload many files/images [SOLVED] Resize image if it's larger than a certain width

25 July 2012 at 2:24pm
@Liam: all physics files and folders are now converter automatically to alphanumeric characters and dashes
-
Re: [SOLVED] SS3 Upload many files/images [SOLVED] Resize image if it's larger than a certain width

26 July 2012 at 12:36pm
One last thing.
How do I access the variable in a loop?
I have this
<% loop Images %>
<a href="$SetWidth(800).URL">$CroppedImage(160,160)</a>
$Image.Width
<% end_loop %>$Image.Width is what doesn't work, everything else is fine. Tried a bunch of var names and nothing works.
| 2586 Views | ||
| Go to Top | Next > |



