473,802 Members | 1,971 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.EventArg s 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.Post edFile != null)

{

// Get a reference to the uploaded file
HttpPostedFile filPosted = filUpload.Poste dFile;
int intFileLength = System.Convert. ToInt32(filPost ed.ContentLengt h);
// 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.Input Stream.Read(byt eData, 0, intFileLength);
}
}
Nov 15 '05 #1
1 1206
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******* *******@TK2MSFT NGP12.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.EventArg s 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.Post edFile != null)

{

// Get a reference to the uploaded file
HttpPostedFile filPosted = filUpload.Poste dFile;
int intFileLength = System.Convert. ToInt32(filPost ed.ContentLengt h);
// 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.Input Stream.Read(byt eData, 0, intFileLength);
}
}

Nov 15 '05 #2

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

Similar topics

3
2578
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 a postback to occur which in turn triggers a sub in a user control... Error: Argument not specified for parameter e of Public Sub UploadDate(Sender As
2
5957
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 doesn't works on IE. Please, help me out as I am new to this and would be highly thankful if anyone has running code for uploading image files to the server using CGI either Perl or C. This code i took it from net only. #!/usr/bin/perl -w
0
1132
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 through an "edit" page to allow a user to adjust their content and resubmit the form and files, either as a draft (which just saves things) or as a real submission (which saves and emails their manager with links back to the content). The problem...
3
19885
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 found at www.srmiles.com/freestuff/ajax_file_uploader/ . you can do multiple file uploads. each upload will have it's own "form"-tag, so that each file is uploaded for its own. could be a good solution if there are "big" uploads.
3
4008
by: kujtim | last post by:
i got html code file name html <html> <head> <title></title> </head> <body>
1
2038
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 and after displayed it.plz tell that how to start the logic. <?php // Connect to database $errmsg = "";if (! @mysql_connect("localhost","root","sreeni")) { $errmsg = "Cannot connect to database"; } @mysql_select_db("my_db1");...
43
9923
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 does. I found a script that does this on easycfm.com (Topic 13543). But anyway when i try to upload multiple files it will create multiple records in my database (like it should), but it wont upload multiple files. What ever file i choose to upload...
12
3381
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 file doesn`t work 2. I select one small file which is uploading 3. I get the status "Complete", but file is not being uploaded, because it doesn`t exist on my server. On the beginning of the upload.php file I`ve added easy insert query into the...
2
1622
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 give the chmod permissions in FTP through fileattributes propery to upload folder it will give the message as Status: Set permissions of '/admin/upload' to '777' Command: SITE CHMOD 777 upload Response: 500 'SITE CHMOD 777 upload': command not...
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9562
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10538
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10305
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.