MVC 3 working with images - asp.net-mvc-3

I'm trying to save images locally and retrieve them to my view. My problem is that i'm really new to MVC and all that I've tried doesn't seem to work.. If there are sites, samples or code snippets that work with locally stored images please feel free to pass on the knowledge...
Thank you

Start out with HttpContext.Server.MapPath("/") in your Controller to get the folder that you are currently working in. Watch where that gives you, and adjust accordingly if you want to maintain any sort of organization.

Related

How Can I Create "Sub-Dashboards" in Looker?

Good morning, all you fine folks in Codelandia. I had a question for anyone out there who has experience using Looker, as I am very new to using this particular software.
I have been tasked to migrate multiple dashboards and visualizations to from our old interface to Looker, and I would like to add more organization to the new setup. The idea I have is to create one "master" dashboard with several sub-dashboards housed within in the master.
The idea would be something like this:
Is it possible that one of you knows if this is possible and/or how to do it?
Thank you!
You can utilize HTML in text boxes to create tabs on your dashboard (in essence links to a completely different dashboard). Here is an example: https://community.looker.com/dashboards-looks-7/tabbed-dashboard-14990
This might be as close as you're going to get.

create-react-app: where do I put dynamically uploaded images?

Hi I'm working with create-react-app, i've setup a file upload that allows images to be sent to the backend and saved locally (to the projects build directory). I'm able to dynamically reference images via localhost:4000/image.png so that already works (ie: i have a blog that lets me upload images that I later access via a blogList).
However i figured this probably isn't the best place to dynamically upload images to. I've read the docs on create-react-app and both the locations that mention images dont seem to work for my use case, i feel like im definitely doing something wrong but im not sure what.
docs im referring to:
Says use "import" however im loading dynamically so i cant see how this would work?
https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#adding-images-fonts-and-files
says use public, however wouldnt that require a rebuild? since im loading dynamically that isnt possible: https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#when-to-use-the-public-folder
NOTE: i have a image uploader and backend working fine it works already using the /build directory. i can upload and dynamically reference images. I'm just looking for best practices for doing something like this. Thanks!
(if you mention "just use nginx" could you please elaborate on the implementation a little)
As a learner I struggled with this problem and tried different approaches once a while ago. For rarely used assets, using /public for client could be useful but I have an app where clients upload images and manage them. Like you, I did not like those approaches and ended up with this setup.
Create a /public directory on backend and upload images to /public/images
Serve /public directory with Express statically.
Use dynamic path variable (via a config setup) for image paths. http://localhost:backend_port/public/images for development and /public/images for production.
I don't know this is the best approach but it worked for me. Beside being best approach when I upload images before that setup CRA was refreshing (hot reloading) my app after each image upload.

Profile image gallery provided by database

I'm currently working on profile images for my registered users.
As of now my users can upload their own images to use and of course there's a default image, incase users don't upload a picture.
By the way, I'm using the Paperclip gem.
I've been trying to do so that my users can choose to select an image from a list of images, provided by the website/database.
This website: https://satwcomic.com/ has exactly what I'm looking for.
Example from the website.
I've been trying to find a solution for this for the past month, but without luck. any hints on how i could successfully achieve such feature with or without paperclip?
I'm hoping to get pushed in the right direction.
Please do keep in mind, I'm still learning Ruby on Rails as a student and any help will be appriciated.

I don't understand how Joomla components are structured

Hello I write this because I started with the Joomla! component development tutorial and I am lost. I have use MVC pattern in other developments and the idea is always the same: model store data, the view ask for data and the controller manage that data flow.
The problem is that in Joomla it is a mess. I have done 5 points of the tutorial, getting data from data base, and without using a Controller. When you have to render a view you have a view.html that does not contain the html code and then, a default.php that contains it. After this, when you start using Controllers, to me, is a party of files randomly placed in different folders. I don't understand a thing because they explain too few appart from "place this file in this route" or add these lines in this file.
So can anybody who understand their implementation of MVC pattern explain it to me? Thanks in advance =)

Symfony Sonata AJAX image multi-upload

I am trying to create a portfolio site and am stuck finding a good approach to deal with images. I have integrated the SonataAdmin Bundle and have setup Admin classes for "Projects" and "Images". My goal is to go into a Project and add images to it and select one of these images as the Project thumbnail.
Ideally I would like to integrate an AJAX multi-uploader. I am not sure the best approach for this and am looking for any suggestions / thoughts.
I have looked at the Sonata Media Bundle, though it seems more robust than I actually need and the learning curve to customize it seems a bit steep. I have already setup an image entity (symfony2 cookbook for uploading documents) I imagine I can create a many-to-one on images and projects rather than using the MediaBundle, though I am still at a loss of how to integrate an AJAX script for this.
Thanks in advance for any advice!
Shawn
I suggest you to look at https://github.com/punkave/symfony2-file-uploader-bundle
This bundle is based on the excellent blueimp jQuery-File-Upload package and provides multiple file uploads.
Edit 28/04/14: There is now also OneupUploaderBundle which supports a variety of uploaders and seems to be under more active development.
checkout https://github.com/ruian/RuianUploadifyBundle its support multiupload but only with flash plugin.
Also this bundle is worth a shot. Not really mentioning AJAX, but seems really strong in basic uploading features. Once you get that done, you can ajaxify by yourself. I'm planning to try this bundle in few days, I may update this answer later.
So I endedup using Valumns Ajax multi uploader: http://valums.com/ajax-upload/
I tried to customize the Sonata Admin Page but this proved a bit difficult, Instead I simply created a route / controller / view specifically for uploading batch images. It seems to be working great!

Resources