What is a filesystem?

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 1164 Views - Last Post: 16 June 2012 - 02:31 AM Rate Topic: -----

#1 unknownmaster80  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 81
  • Joined: 06-August 11

What is a filesystem?

Posted 14 June 2012 - 06:36 AM

How to store images in filesystem? I have been searching them as I found that most people agree that storing it in a filesystem is better than storing it in filesystem..
So anyone got any examples of storing them in filesystem? And how do I retrieve it from my visual studios as it is linked to my database for it.
Thanks

btw. got any free filesystem if it is not sql server 2008?

This post has been edited by unknownmaster80: 14 June 2012 - 06:49 AM

Is This A Good Question/Topic? 0
  • +

Replies To: What is a filesystem?

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5537
  • View blog
  • Posts: 11,868
  • Joined: 02-June 10

Re: What is a filesystem?

Posted 14 June 2012 - 07:02 AM

Start by working on your English because we can't follow what you're saying.

Quote

most people agree that storing it in a filesystem is better than storing it in filesystem..

You just said "A is better than A"... Kinda meaningless.


A file system would be... FAT, FAT32, NTFS... The file system your OS uses to store files.

Storing in a file system means "Save". You probably do it 100 times a day. When you make a new document in Word and save it to your hard drive, you just stored it in a file system.

So before you even start trying to write code in whatever language you are working in, you probably should take an intro to computers course and learn the basics of operating a PC before you try to code for one. Then take an intro to databases course since that is the forum area you posted in.



See FAQ # 23 for database tutorials. (Click the SHOW button below)


TOP most asked:
What does this error message mean?
FAQ 2: How do I debug
FAQ 3: How do I make Class1/Form1 talk to Class2/Form2


FAQ (Frequently Asked Questions - Updated May 2012
Spoiler



Was This Post Helpful? 0
  • +
  • -

#3 unknownmaster80  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 81
  • Joined: 06-August 11

Re: What is a filesystem?

Posted 14 June 2012 - 07:08 AM

Oops sorry..What I meant is that I have searched online and most people agree to store images in a filesystem instead of storing it in a database. I have learnt the basics of database but not to the extend that needs to store images so I was just curious about it whether to use filesystem or database. BUT..I do not have any knowledge in filesystem. But I am going to look at your comments to find more about it. Thanks
Was This Post Helpful? 0
  • +
  • -

#4 unknownmaster80  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 81
  • Joined: 06-August 11

Re: What is a filesystem?

Posted 14 June 2012 - 07:17 AM

Ok..Erm..i do not get anything after
See FAQ # 23 for database tutorials. (Click the SHOW button below)
cause it is all C# although i know it is similar. but anyways, is there a way to store the images in my computer then since your example state so?
I mean first you upload the images to the web, then store it in my computer? Is that possible?
Was This Post Helpful? 0
  • +
  • -

#5 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9287
  • View blog
  • Posts: 34,811
  • Joined: 12-June 08

Re: What is a filesystem?

Posted 14 June 2012 - 07:26 AM

I think I might be able to clear some issues up here.

A database sites on a file system. A file system, in this case, is another word for operating system. You can have a database sit on a windows OS, linux, mac, or even something like OS/2 Warp. Typically a database sits in a server environment so other people on the network can access it from different locations.

When people say "store images in a file system" they mean store them in a folder and have the database store the path to the image. Just like you would do on your computer now!

Let's take an example..

You are using Windows Server 2008... and your database is MSSQL 2008. You want to store all your images in a folder right off your c drive.. Not the best idea but it works in this example. You want to store them in a folder called "images".

You have an application being ran by a user. They click 'upload image' and select something off their machine. The code kicks off transferring the file to Windows Server 2008 machine and puts it into that c:\images folder. When it does that it also gives it a unique name. GUID datatypes are great for that! You give it a unique name so you avoid having people upload different images with the same name.

With your guid and path in hand you app then inserts a row into the database.. typically the user's id who uploaded the photo adn then the image path.. which would be "c:\images\<guid #>.jpg" or what ever. If you plan on having a constant folder for all the images you can probably drop off the "c:\images" and just have that hardcoded, but I am a dork and enjoy having the full path.

Now if the user ever requests to SEE that image they loaded up the app queries the database and returns the path to the image... or it returns the file bytes from the known location (path).

The other alternative is to convert your image into a binary array and store that in your database. This is do-able, but not ideal since you would need to break the tables into a 'data' table to hold all the binary array data and an index table for quick searching. It bloats up the table and also skews the purpose of the database. Well.. at least in my opinion.
Was This Post Helpful? 1
  • +
  • -

#6 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5537
  • View blog
  • Posts: 11,868
  • Joined: 02-June 10

Re: What is a filesystem?

Posted 14 June 2012 - 07:27 AM

Its not all C#. Most of the tutorials in the Database tutorials are are SQL
Here ya go: mySQL tutorial that doesn't use any specific coding language.

Quote

I mean first you upload the images to the web, then store it in my computer? Is that possible?

Yes it is. Just as you said: Upload it, then save it.

This post has been edited by tlhIn`toq: 14 June 2012 - 07:28 AM

Was This Post Helpful? 1
  • +
  • -

#7 unknownmaster80  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 81
  • Joined: 06-August 11

Re: What is a filesystem?

Posted 14 June 2012 - 08:29 AM

mod: excessive quote removed..
Erm. GUID is it meaning like this?

CREATE TABLE dbo.Image
(
ImageID int,
ImageName varchar(200),
ImagePic varchar(200),
CONSTRAINT PK_ImageID PRIMARY KEY NONCLUSTERED (ImageID),
....
)

Where ImageID is the GUID?
Cause if it is so, then may I know how do I get the ImageID when it is not created yet?
Won't it get some errors in it?

This post has been edited by modi123_1: 14 June 2012 - 08:33 AM
Reason for edit:: removed giant quote

Was This Post Helpful? 0
  • +
  • -

#8 unknownmaster80  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 81
  • Joined: 06-August 11

Re: What is a filesystem?

Posted 14 June 2012 - 08:34 AM

View PosttlhIn`toq, on 14 June 2012 - 07:27 AM, said:

Its not all C#. Most of the tutorials in the Database tutorials are are SQL
Here ya go: mySQL tutorial that doesn't use any specific coding language.

Quote

I mean first you upload the images to the web, then store it in my computer? Is that possible?

Yes it is. Just as you said: Upload it, then save it.


Thanks alot! Your tutorial was great but just a question. I know there is such a datatype called double. But I could not use double in sql.

example:

CREATE TABLE dbo.example
(
ExampleID int,
ExampleName double,
...
)

I was returned an error if it is double? Or is it only mine? I am using Microsoft SQL Server 2008.
Was This Post Helpful? 0
  • +
  • -

#9 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9287
  • View blog
  • Posts: 34,811
  • Joined: 12-June 08

Re: What is a filesystem?

Posted 14 June 2012 - 08:37 AM

I am not sure what you are asking.

GUID as in a unique identifier.
http://msdn.microsof...y/ms187942.aspx
http://msdn.microsof...ystem.guid.aspx

Typically a language framework like .NET can generate one from code.. or at least you can insert the record (since you know the location the file is going - it's always going to "c:\images" and have your SQL generate the GUID... and then return that GUID so you can can the file name when you store it in the specific path.


Quote

I know there is such a datatype called double. But I could not use double in sql.


Try reading up on the documentation on MSDN.

Quote

The SQL Server float[(n)] data type complies with the ISO standard for all values of n from 1 through 53. The synonym for double precision is float(53).

http://msdn.microsof...y/ms173773.aspx
Was This Post Helpful? 1
  • +
  • -

#10 unknownmaster80  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 81
  • Joined: 06-August 11

Re: What is a filesystem?

Posted 14 June 2012 - 08:59 AM

Hmm, actually i was thinking that guid might be a primary key or something. but maybe not..
Then is there any other easier examples for it?
And is GUID created in VB.net or database cause the website you gave me are for VB.Net and is a bit confusing cause I don't think i got learn it before. :X
Was This Post Helpful? 0
  • +
  • -

#11 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5537
  • View blog
  • Posts: 11,868
  • Joined: 02-June 10

Re: What is a filesystem?

Posted 14 June 2012 - 09:03 AM

View Postunknownmaster80, on 14 June 2012 - 08:17 AM, said:

Ok..Erm..i do not get anything after
See FAQ # 23 for database tutorials. (Click the SHOW button below)
cause it is all C#



View Postunknownmaster80, on 14 June 2012 - 09:59 AM, said:

... cause the website you gave me are for VB.Net and is a bit confusing cause I don't think i got learn it before. :X


So in other words you don't know C# or VB.NET but you want to write a program? You need to learn a coding language.





I will say again... You need to read about the things you are trying to use BEFORE you try to use them. Just banging on the keyboard with no understanding hoping you magically stumble across something that works is no way to learn or code.

I'm going to give you a ton of resources you can use to learn how to code, then bow out of this conversation because I'm not interested in being your private tutor or hand-holding you through learning every basic concept, command, and data type.


There are three routes people seem to take when learning programming.
  • Just start trying to create programs
  • Start taking apart other programs and try to figure out the language by reverse engineering
  • Follow a guided learning course (school or self-teaching books)


For the life of me I can't figure out why people try 1 & 2.
Sure, 35 years ago the only way I could learn BASIC as a kid was to type programs from a book into a TRS-80 model 1 or Commodore VIC-20, then figure out the commands and syntax by watching the results as the program ran. There simply wasn't any courses for a kid back then.

But now, you can't help but to trip over "Learn {coding language} in 3 weeks" type books and the entire internet is at your disposal for tutorials.

I strongly suggest taking the guided learning approach. Those book authors go in a certain order for a reason: They know what they're doing and they know the best order to learn the materials.

Quote

Where do I start?


You start by learning a coding language FIRST.
Learn to plan before you type.
THEN you start designing software with a purpose.


If this sounds like you

Newbie/Rookie said:

I have a little programming experience but I need to write ...
read this section
Spoiler


Otherwise, you can just jump to the resources here:
Some of the tutorials below are for C# or Java not C, C++, VB.NET [...]. But the conceptual stuff of classes, object oriented design, events etc. are not language specific and should give you enough guidance in theory of program development for you to be able to look-up specific code example in your chosen coding language.



Resources, references and suggestions for new programmers. - Updated Mar 2012
Spoiler

This post has been edited by tlhIn`toq: 14 June 2012 - 09:07 AM

Was This Post Helpful? 0
  • +
  • -

#12 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9287
  • View blog
  • Posts: 34,811
  • Joined: 12-June 08

Re: What is a filesystem?

Posted 14 June 2012 - 09:06 AM

Quote

Hmm, actually i was thinking that guid might be a primary key or something. but maybe not..

GUIDS can be used as a key, but keys are not always guids.

Quote

Then is there any other easier examples for it?

Easier than what? That verbose story I gave a few posts above was the broad brush strokes of how one might go about this chore.

Quote

And is GUID created in VB.net or database cause the website you gave me are for VB.Net and is a bit confusing cause I don't think i got learn it before. :X

I have no idea what this means.
Was This Post Helpful? 1
  • +
  • -

#13 unknownmaster80  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 81
  • Joined: 06-August 11

Re: What is a filesystem?

Posted 14 June 2012 - 09:26 AM

tlhIn`toq, I think you are misunderstanding all this but I have at least the basics for vb.net like creating a simple website. I also do have the basics for sql server 2008. It is just nice I really did not understand GUID plus the examples given was not something that I had learnt in school.

Example
' Guid for the interface IMyInterface.
<Guid("F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4")> _
Interface IMyInterface
Sub MyMethod()
End Interface

I know your generation was to study yourself from scratch. I cannot deny but I do 1 & 2 most of my time but I did actually try my best to study hard in 3 too. But I need the help from people like you. Lastly, why are all your sentence is like trying to scold me? I know you are professional already but I am a newbie here struggling. I am not trying to ask you to be my tutor, give me answers or anything. But at least guide me through by having some examples?

This post has been edited by unknownmaster80: 14 June 2012 - 09:27 AM

Was This Post Helpful? 0
  • +
  • -

#14 unknownmaster80  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 81
  • Joined: 06-August 11

Re: What is a filesystem?

Posted 14 June 2012 - 09:49 AM

View Postmodi123_1, on 14 June 2012 - 09:06 AM, said:

Quote

Hmm, actually i was thinking that guid might be a primary key or something. but maybe not..

GUIDS can be used as a key, but keys are not always guids.

Quote

Then is there any other easier examples for it?

Easier than what? That verbose story I gave a few posts above was the broad brush strokes of how one might go about this chore.

Quote

And is GUID created in VB.net or database cause the website you gave me are for VB.Net and is a bit confusing cause I don't think i got learn it before. :X

I have no idea what this means.


Ok. I just realised you gave me one was for sql and the other vb coding. Thanks for the info. I will try and understand the codings even though it is still confusing. :smile2:
Was This Post Helpful? 0
  • +
  • -

#15 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6066
  • View blog
  • Posts: 23,526
  • Joined: 23-August 08

Re: What is a filesystem?

Posted 15 June 2012 - 08:16 AM

Quote

I know your generation was to study yourself from scratch.


Love it when we're inferred to be old farts (rightly or wrongly) because we actually put in the effort to learn things without spoonfeeding.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2