Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > uploading files on the server and using SQL Xpres05/08 to link

Reply
Thread Tools

uploading files on the server and using SQL Xpres05/08 to link

 
 
Jim in Arizona
Guest
Posts: n/a
 
      06-05-2009
I've reached a brick wall with my last attempt to make a simple
upload/download page and storing files in a folder on the hosting computer.
There is a glitch in ASP.NET (or VB.NET or something) that makes this not
happen.

So, I'm wondering about another potential. What about using SQL Express 2008
to store a link to the uploaded file somewhere on the hosting computer? I
can't seem to find any articles about doing this. These files will be large;
upwards of 500 megs each so the 4gb limit in SQL Express isn't an option for
actually storing the files.

TIA,

Jim

--



 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      06-05-2009
On Jun 5, 7:28*pm, "Jim in Arizona" <(E-Mail Removed)> wrote:
> I've reached a brick wall with my last attempt to make a simple
> upload/download page and storing files in a folder on the hosting computer.
> There is a glitch in ASP.NET (or VB.NET or something) that makes this not
> happen.
>
> So, I'm wondering about another potential. What about using SQL Express 2008
> to store a link to the uploaded file somewhere on the hosting computer? I
> can't seem to find any articles about doing this. These files will be large;
> upwards of 500 megs each so the 4gb limit in SQL Express isn't an option for
> actually storing the files.
>
> TIA,
>
> Jim
>
> --


Do you mean you can't make it working even with a small file? IIS,
ASP.NET, and browsers limit the size of uploaded files. See more at
http://support.microsoft.com/?id=295626
 
Reply With Quote
 
 
 
 
Jim in Arizona
Guest
Posts: n/a
 
      06-08-2009
Hi Alexey,

You gave me the link initially that pointed me in the right direction to get
started but I ran into an intersting issue. File size was not a problem
since that limitation could be changed in the web.config file. I wrote a
somewhat long and detailed question on the issue in this newsgroup under the
subject of "virtual directory and hyperlink file path issue (listed and
linked paths don't match)" but no one had a response. Here is that message
in its entirety.

==================================================

Some basic code to display files in a directory, in this case, C:\webfiles

What's interesting is the difference between using system.io.directory and
system.io.directoryinfo classes.
When displaying files simply with directory, I can do this:

Dim filelisting() As String = Directory.GetFiles("C:\webfiles\")
DataGrid1.DataSource = filelisting
DataGrid1.DataBind()

That works just fine, although with no hyperlinks or anything.

When using directoryinfo, I have to do this:

Dim dirinfo As New DirectoryInfo(Server.MapPath(".\webfiles\"))

DataGrid2.DataSource = dirinfo.GetFiles()
DataGrid2.DataBind()

I had originally tried to specifiy Server.MapPath("C:\webfiles\") like with
the directory class but this didn't work. It threw an error saying it was
not a virtual directory. To solve this, I opened IIS up and created a
virtual directory called "webfiles" within the working directory of this
asp.net web form (C:\Inetpub\wwwroot\tests). This virtual directory was
mapped to C:\webfiles. This works fine to display the files, with
hyperlinks, by doing this in the aspx page.

<aspataGrid id="DataGrid2" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="Name" DataTextField="Name"
HeaderText="File Name" />
</Columns>
</aspataGrid>

And, in the aspx.vb code behind page (same as shown above):

Dim dirinfo As New DirectoryInfo(Server.MapPath(".\webfiles\"))

DataGrid2.DataSource = dirinfo.GetFiles()
DataGrid2.DataBind()

This works to display the file names in C:\webfiles with hyperlinks, but
when I click on one, I get a 'page cannot be found' message. When looking at
the path when I hover the mouse over the link, it shows:
http://localhost/tests/myfile.doc

It should be showing:

http://localhost/tests/webfiles/myfile.doc

since webfiles is the virtual directory it is getting the file listing from.
If I directly insert that address into the address bar of the web browser, I
get the file.

Other than just placing all the files into the C:\Inetpub\wwwroot\tests
folder and not worrying about virtual directories, how can I solve this
issue. My current environment is a test environment and in the future, in a
production enironment, the virtual folder would probably be a share on
another machine so I'd like to solve this rather than taking the easy way
out and not messing around with virtual directories.

TIA,
Jim
--
==================================================

One thing of note from the problem above is that I don't want everyone to
see the .aspx and .aspx.vb files in the directory listing, which is the case
in the glitch above.

So, since I can't seem to get it going with the filesystem, I was thinking
of using SQL tables with an internal link that pointed to a file somewhere
in the filesystem and, in doing so, hoping to get around the aforementioned
problem(s).

Thank,
Jim



--

"Alexey Smirnov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
On Jun 5, 7:28 pm, "Jim in Arizona" <(E-Mail Removed)> wrote:
> I've reached a brick wall with my last attempt to make a simple
> upload/download page and storing files in a folder on the hosting
> computer.
> There is a glitch in ASP.NET (or VB.NET or something) that makes this not
> happen.
>
> So, I'm wondering about another potential. What about using SQL Express
> 2008
> to store a link to the uploaded file somewhere on the hosting computer? I
> can't seem to find any articles about doing this. These files will be
> large;
> upwards of 500 megs each so the 4gb limit in SQL Express isn't an option
> for
> actually storing the files.
>
> TIA,
>
> Jim
>
> --


Do you mean you can't make it working even with a small file? IIS,
ASP.NET, and browsers limit the size of uploaded files. See more at
http://support.microsoft.com/?id=295626


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help. Getting a An error has occurred while establishing a connectionto the server. When connecting to SQL Server 2005, this failure may be causedby the fact that under the default settings SQL Server does not allow remote aboutjav.com@gmail.com ASP .Net 0 05-03-2008 12:43 PM
ftp uploading vs. control panel uploading Dung Ping HTML 10 01-16-2006 10:43 AM
Uploading downloading Image to SQL Server using ASP.net and VB.Net =?Utf-8?B?SlA=?= ASP .Net 1 08-10-2005 06:44 PM
How to read an SQL Server into a ASP page and then change, add, delete and write it back to SQL Server Belinda ASP General 4 06-11-2004 12:16 PM
Can't connect to SQL Server, using Windows Authentication users of SQL server? help =?Utf-8?B?UmV6YQ==?= ASP .Net 3 06-07-2004 06:42 PM



Advertisments