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

L

Luis

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);
}
}
 
T

Tom Carter

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top