473,387 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problem with Upload... please help me...

Hi, I can this code, but I can't save the archive in the blob camp into my
MySQL Database... ¿why? can you help me? I work with c# and MySQL in a
ASP.NET application... Now, Theoretically in the field byteData estan the
information of the file. This information I them sending to save to the
database them passing for a reference, but it does not do it. what can
happen?

public void btnUpload_Click(object sender, System.EventArgs e)

{
// If no file was uploaded then you probably want to inform the user to
select a file
// before clicking the upload button.
if (filUpload.PostedFile != null)

{

// Get a reference to the uploaded file
HttpPostedFile filPosted = filUpload.PostedFile;
int intFileLength = System.Convert.ToInt32(filPosted.ContentLength);
// Ensure that there were contents to the file. Exit out of the function if
there is no content.
if (intFileLength == 0)
{
return;
}
byte[] byteData = new byte[intFileLength];
filPosted.InputStream.Read(byteData, 0, intFileLength);
}
}
Nov 15 '05 #1
1 1195
Hi Luis,

Depending on the size of the image file and the fact that you are
using ASP.NET/MYSQL I would recommend that you store an <img> link to
the uploaded file rather than trying to put the image into the
database.

~~~~~~~~~~~~~
Tommie Carter
www.premiertechnology.com
--
"Luis" <ll*@telefonica.net> wrote in message news:<OO**************@TK2MSFTNGP12.phx.gbl>...
Hi, I can this code, but I can't save the archive in the blob camp into my
MySQL Database... ¿why? can you help me? I work with c# and MySQL in a
ASP.NET application... Now, Theoretically in the field byteData estan the
information of the file. This information I them sending to save to the
database them passing for a reference, but it does not do it. what can
happen?

public void btnUpload_Click(object sender, System.EventArgs e)

{
// If no file was uploaded then you probably want to inform the user to
select a file
// before clicking the upload button.
if (filUpload.PostedFile != null)

{

// Get a reference to the uploaded file
HttpPostedFile filPosted = filUpload.PostedFile;
int intFileLength = System.Convert.ToInt32(filPosted.ContentLength);
// Ensure that there were contents to the file. Exit out of the function if
there is no content.
if (intFileLength == 0)
{
return;
}
byte[] byteData = new byte[intFileLength];
filPosted.InputStream.Read(byteData, 0, intFileLength);
}
}

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Tim::.. | last post by:
Can someone please tell my why I get the following problem when I type the following piece of code! How do I get around this??? The idea is that when a user clicks a button on a form it causes...
2
by: prakharv | last post by:
Hi All, Below is the code which I am using to upload a jpeg file to the server. But the problem I am facing is that it is not copying the entire contents of the image file to the webserver and it...
0
by: RichBurdes | last post by:
Hi All, I've just started using ASPupload and can successfully submit files to a directory on the web server and form data to a database - i can then retrieve the form data and links to the files...
3
by: markus.rietzler | last post by:
i want to do (multiple) file upload(s) and display a progress bar. with firefox and safari it is no problem at all. only IE makes some problems. my script is based on ajax-uploader, which can be...
3
by: kujtim | last post by:
i got html code file name html <html> <head> <title></title> </head> <body>
1
by: sravani1 | last post by:
This code runs like when i submit the form it takes the image and displayed and top of the image a map will displayed. But actually i want that when i give the image it checks the location in the map...
43
by: bonneylake | last post by:
Hey Everyone, Well this is my first time asking a question on here so please forgive me if i post my question in the wrong section. What i am trying to do is upload multiple files like gmail...
12
by: K. | last post by:
Hello! I have a problem with SWFupload class1. I have the page with uses SWFUpload class. Everything worked fine until (I suppose my admin) implemented some changes into the server. Now uploading...
2
by: swethak | last post by:
Hi, i wrote a code to upload a image.In my local it works fine. When i place this code in website through FTP. In that it will not works. i am giving the upload path ../upload . When i try to...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.