How To Organize And Manipulate Pictures In Filesystem
Aug 26, 2010
Although it may not seem like that but there is a little questions about this subject.I am not asking if I should use DB or filesystem, the file system it is, but I am asking what is the best way of organizing pictures in file system that will be used with asp.net application? I am talking about tens or even hundreds of thousands of picture.
To elaborate a question a bit.
Where should repository be located, create another VD in IIS or in application VD, or somewhere outside IIS?
How to organize file patsh, put them all in one folder or create subfolders. If so how to name all those folders?How to handle multiple sizes of the same image? where to locate them?How to sync folders and images with database?What else crosses your mind, and you think it's important..
I've done something myself allready, but I am asking if someone had some experience with this. Maybe it could be done better yours way.
I put things like this
I stored pictures in IIS folder, because storing them outside of iis make them unable to use in web, because of paths. You cannot use file path in web, it must be virtual file path.
http://images/1.jpg istead of C:images1.jpg
in the root I had subfolder for each picture size
root-
+400x300
+600x400
+1024x768
Named images by id from database. If the ImageID from database is 45678909, the name of picture is 45678909.jpg an it's location is
VDimages400x30045678945678909.jpg
VDimages600x40045678945678909.jpg
I sliced the picture name two by two, and create subfolders. the point was not to have more than 100 files in folder. Was this good idea or stupid one? How would you organize this? For person, this organization with tons of folder is not easy to use.
Name of the image with its relative path I saved in database table with description and time of insert etc. path: 45678945678909.jpg
View 2 Replies
Similar Messages:
Mar 3, 2011
Suppose there is one folder "D:Main" which can contain any word file. On adding any file/files to the folder I need to parse the file and based on some keywords I need to transfer the file to some other sub folders as well as some entry to the database also.
I know something about FileSystemWatcher. If there would have been a button like "Check and Move" then I know that on the button click event I can do something but how to do it automatically. I mean if I add file to the folder manually also it should do the same(files may be uploaded via web as well as manually).I am currently working in web application with asp.net and c# and I have a little knowledge about windows application.
View 2 Replies
Dec 11, 2010
My question about I created a web site as a file system if I need to publish it what is the rules I follow.
View 2 Replies
Jan 28, 2011
HOw to view the loaded videos which are in filesytem from MVC pattern architecute. Suggest links or code to view the videos in Windows Media player or other players which supports defaultly by MVC.
View 1 Replies
Jan 11, 2012
I need to retrieve an image from a database file and save it to the file system.
Lets say I have this so far
Code:
Dim query As String = "Select Foto From tblImagenes Where ItemId = ?"
Dim conn As New OleDbConnection(ConfigurationManager.ConnectionStrings("Conexion1").ConnectionString)
Dim com As New OleDbCommand(query, conn)
[Code].......
I-m getting an error about the wrong parameter to the bitmap.
View 1 Replies
Dec 6, 2010
I have an report that is in pdf file. Everytime the user click the button, it will go to SQL database and pull up the data, and then create the pdf file based on that data.
I wanted to save the pdf file the first time user click on the link. So that when he / she come back and open the report, instead of going to the data base and pull the data. It will just pull the pdf file from the file system. Here are the code that I have :
Dim parameterUid As String = CStr(Request.QueryString("Uid"))
View 1 Replies
Jun 30, 2010
Is it possible to read an .aspx-file from the filesystem, probably translate it into the Page-object and then render it into HTML? And then writing it back to the filesystem as a .html file.
The .aspx file on the filesystem is without the codebehind file. If possible provide me some example code.
View 6 Replies
Oct 14, 2011
Now I want to create several filesystemwatchers in my Windows Service and have them monitor different folders but do basically the same thing when files are created. That is, they will be calling the same routines. So my code so far is this:
Code:
// 10/14 - Create N fsw's as specified in the config file.
int nbrFsw = Convert.ToInt32(ConfigSettings.ReadSetting("NumberOfWatchers"));
List<FileSystemWatcher> listOfFsw = new List<FileSystemWatcher>();
for (int i = 0; i < nbrFsw; ++i) {
FileSystemWatcher fsw = new FileSystemWatcher();
[Code] ....
Is there a potential problem that all fsw's that get created are calling the same "on created" event handler? Or will this work nicely?
My requirement is this. I need to watch Output folders and when pdf files are created here I upload the files to a server. These Output folders are in web app deployments. I need to do this function for more than one deployment on the same machine, thus my need for more than one fsw.
This will ultimately be a web service but I am trying this out in a windows program, hence the presence of lblMessages which is on a windows form...
View 10 Replies
Apr 9, 2010
I'm building ASP.Net MVC 2 application using Repository pattern. My question is how to organize my application. Most of the examples I see on the web, using separate Modelproject with Repositories and Entity Data Model. These examples are not using MVC Model folder.
I have 3 projects in my solution.
1. Application (MVC Project)
- Models
- Repository (Here I want to create Repository folder for my Repository)
- IRepository (Also I want to create IRepository folder for my Interface)
2. DataModel ( Which will have my Entity Data Model and my POCO T4 Template)
3. Test
View 5 Replies
Apr 28, 2010
I am writing web application using ASP.NET MVC + NHibernate + Postres stack. I wonder if images uploaded should be stored in database as binary blobs or on filesystem (and reference only in db).
One advantage of db storage I can think of is easy backup/recovery of all data without reverting to filesystem copy tools. On the other hand I suspect that filesystem access may be faster (but is it especially when dealing with many concurrent requests?)
View 3 Replies
Mar 12, 2011
I understand the basics of setting up routes, I am trying to get a handle on how to organize more complex routes. Does the Route name do anything? I havn't seen a place it's actually used. If I have the route: controller/action/id/paramA/paramB/paramC. ParamA-C could be defining multiple parameters so First/Last/Zip or Phone/Zip/Birthday. Is it common practice to name the additional parameters with a generic name like paramA vs trying to differentiate a separate route for each?
Lastly, if you have multiple sites/functional areas in 1 site, lets say the asp.net site, each area MVC, Ajax, Forums ect were all different functional areas. Is it best to create a different group of routes such as hard coding the controller like:
MVC/action/id
Ajax/action/id
Forums/action/id
or is there a better way? What I am running into is 1 piece of the site overriding the other route because of the number/type of parameters.
View 5 Replies
Nov 11, 2010
I use ASP.NET in C#, I am pretty new at developing so I would like have some advice from experts :-).uestions:What is the best ractice to organizing CLASS FILES?What kind of name do you use?For Web Application Project, how do you name NAMESPACE?In my Case I am building a simple CMS. I thought the FILE structure like this:
- AppCode
- Common
- UserDataInput.cs
- ExternalLibrary
[code]...
View 1 Replies
Jul 23, 2010
How to export binary data from table to filesystem via stored proc
View 2 Replies
Jan 23, 2011
In a website, I see some developers put code into app_code, and sometimes appcode (due to some bug), other files into DataModel, and other files into miscellaneous folders.
Is there a standard approach to organizing code within an application?
How is it different between an ASP.NET, MVC, Silverlight, Console, Database, and WCF application? The reason I mention WCF is because many people seem to have a shared types library that is linked between the server and client code.
Where can I learn these common practices without having to try, fail, and try again. I'd rather just learn it once from the experts.
View 3 Replies
Apr 20, 2010
I have several ASP.NET sites in IIS7 and would like to be able to group them into folders (or other mechanism, if available). Ideally, I would use a customer name or account number and put the sites under there.
Is there a way to customize the organization of sites in IIS7, or is there just the one 'flat' view?
I'm open to tricks and hacks.
View 1 Replies
Jan 31, 2011
+1 if you are specific to ASP.NET MVC projects.
Update 9:42 PM:
I am thinking about this from now as I need several developers across the globe to work on this project. We will be using VS 2010 and I heard some thing about web application templates.
View 2 Replies
Oct 14, 2010
I wrote some code to connect the application to it's database, then I created some code to use the connection code and retrieve, update or add some values to the database, Also I might have some code to deal with other stuff than to deal with the database
The code is a little complicated, maybe it's simple but it's not short, for example to write a good piece of code to just retrieve a single value so I could set the controller with this value I used this :
SqlConnection sqlconnection= new SqlConnection(ConfigurationManager.ConnectionStrings["DefConnectionString"].ConnectionString);
SqlCommand sqlcommand = new SqlCommand("SELECT name FROM message WHERE id = 3", sqlconnection);
try
{
sqlconnection.Open();
lbl_name.Text = (string)sqlcommand.ExecuteScalar();
Status.Text = "Done";
}
catch (Exception ex)
{
Status.Text = ex.Message;
}
finally
{
sqlconnection.Close();
}
I might even add some code to store some info in the database about any exception is thrown, I think the code is pretty basic, yet it's not small, given that it's the smallest piece I'll need, some huge code is written for adding or editing new items, and also consider that it's not the only code I'll write in the page, the page has more needs.
I've provided a detailed case I hope!...So what do you think will be the best way to make my page fast and easy to read and have an organized code I've started placing every code in an appropriate method, but some methods are common so I create them again in every page that needs them like a ConnectionToDataBase Method, and mean while I think I just organized the page so I could mainly look at Page_Load and see what are the called methods and then scroll down to read the definition but It's still a big page and note the best practice I think
Sorry for all the big question, I just provide details so I could get a reasonable answer for my question, I hope everyone benefits from it as most questions are pretty basic, newbies like me needs some detailed cases and answers to get a better start.
EDIT: I know I'm new, So any comments on my code are more than welcome!
View 1 Replies
Jan 8, 2010
I am trying to understand how best to organize some common Dropdown lists used in several views (some are cascading)
Is it best to create a single ModelsCommonQueries then create a webservice for each dropdown used in cascading situation then have a single controller that contains actions for each dropdowns
This way I can follow DRY principle and not repeat the dropdown logics since they are used in various views.
View 1 Replies
Jan 8, 2010
I realize that VS200X can ident asp files properly, however, for the sake of ease in finding attributes, is there a tool that will also organize the attribute order within a tag alphabetically? I'm always scanning around a tag visually and if the attributes were sorted alphabetically, asides maybe from ID and runat which should remain first, I would have a much easier time.
View 2 Replies
Aug 31, 2010
its my code where I giving out paging of view:
<div style="float: right;">
<%= Html.RouteLink("<<", new { page = 1 }, new { title = "first page" })%>
<% if (this.Model.HasPreviousPage) [code]...
it looks like this:
<< 1 2 3 > >>
I want to show always just a two pages before and after selected page.If Iam on page 4, I will see all 3 pages before like this.
<< < 1 2 3 **4** > >>
how to manipulate this.
my model has following data for paging:
/// <summary>
/// Gets the boolean value of previous page
/// </summary>[code]....
View 1 Replies
Jan 27, 2011
I've looked all over the web for the best way to organize an ASP.NET MVC2 project. I've only seen examples of people using the default template for MVC2 projects. But is this the best way to organize your project if it is going to contain a large number of files?
We're in the process of building an application that is heavily built around jQuery for UI and ajax using JSON. So, as you can imagine, we will have many custom .js support scripts.
In our solution, we have placed all our support libraries (3rd party and custom) into respective projects. The MVC2 project that is also in the solution is using the default MVC2 template.
In the MVC2 project, the "starting" structure is still pretty much unchanged. Under the Controllers directory, we have each controller AccountController.cs and HomeController.cs (for example). Under the Views directory, we have three subdirectories named Account, Home, and Shared. In the Scripts, directory we have also divided that up with three directories, Account, Home, and Shared. And finally we have the Models directory, that is also divided into Account, Home, and Shared subdirectories.
As you can see we haven't deviated from the basic template that much. But, as we start adding stuff to this, we're realizing how cumbersome this might become when we get upwards to 20 or 30 views and 100 support .js files.
View 1 Replies
Feb 25, 2011
I've been working with MVC for awhile and I'm not sure what works with asp.net.
Is it possible to organize code outside the App_Code directory or into separate projects? How would this be done?
View 2 Replies
May 5, 2010
I work in a suite of ASP.NET applications that have several different "modules". The applications all share a main menu, so they all link to one-another. The modules are the high-level areas of the application. So, for example, it might be Payments, Orders, Customers, Products, etc. And Payments and Orders are in one app and Products and Customers are in another. Some of these menu links are "deep links", for example it might be a link to a particular page within the Customers module, such as Create New Customer.
We are about to start a project that will add several more modules to this suite, probably as a new .NET application. I'm thinking about doing these new modules in Silverlight (for various reasons that are not material to the question). If I were to do that, I need to make the menu look the same as the menu in ASP.NET, as the users still need to feel like they are inside one "application".
How should I organize the Silverlight project(s) so that I can "deep link" from ASP.NET pages into particular modules in the Silverlight app? What is even the best idea for creating these different Silverlight "modules"? If I had something that would've been a page in ASP.NET (for example - Create Customer), should each one of those be a separate Silverlight app? Or should it be a separate User Control? Or something else? Should I reuse our shared ASP.NET menu, and deep link to different Silverlight "modules" even within the new application? Or should I reimplement the menu in Silverlight for navigation within the app? Are there menu controls for Silverlight that look similar to ASP.NET menus (with flyout submenus in this case)? Could I maybe even share a SiteMap XML file between them?
View 1 Replies
Sep 12, 2010
I want to change some elements text when page is leaving the server (page_render, endRequest etc.).
How can i get access to the page and how can i find the elements to change their values, texts?
View 3 Replies
Feb 12, 2010
have a situation very similar to the one in this question:http://stackoverflow.com/questions/774695/selective-cache-clearing-across-load-balanced-servers-asp-netThe difference is that due to our hosting configuration, I am unable to address individual servers by IP address. Assuming I cannot access specific servers via web requests, is it possible to access the HttpContext of a web application running on the same machine? I'm thinking I could accomplish this with a windows service that I could address by machine name, or alternately a console application
View 1 Replies