473,657 Members | 2,545 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Image Uploader; Worked in .NET 1.0 now not working in 1.1?

Hi,

I have recently upgraded .NET from 1.0 to 1.1 and now an application I am
writing is no longer uploading the files, any ideas? I have posted the
relevant code below...

<%@ Page Language="C#" %>
<%@ Import Namespace="Syst em.IO" %>
<%@ Import Namespace="Syst em.Drawing" %>
<%@ Import Namespace="Syst em.Drawing.Imag ing" %>
<%@ Import Namespace="Syst em.Text" %>
<script runat="server">

void Button1_Click(o bject Source, EventArgs e)
{
txtMsg.InnerHtm l = saveFiles();
}
string saveFiles() {
string strMessage = "";
string[] uploadArray = new string[6];
string strFileName;
string propertyPath;
string thumbnailPath;
string appPath;
string iString;
string propertyIdLocal ;
string uploadPhoto1Loc al;
string uploadPhoto2Loc al;
string uploadPhoto3Loc al;
string uploadPhoto4Loc al;
string uploadPhoto5Loc al;
string uploadPhoto6Loc al;
HttpPostedFile objFile;

propertyIdLocal = MC_propertyId.T ext;

appPath = Server.MapPath( "../photos/");
Directory.Creat eDirectory(appP ath+propertyIdL ocal);
Directory.Creat eDirectory(appP ath+propertyIdL ocal+"/thumbnails");
propertyPath = Server.MapPath( "../photos/"+propertyIdLoc al+"/");
thumbnailPath = Server.MapPath( "../photos/"+propertyIdLoc al+"/thumbnails/");

for (int i=0; i<Request.Files .Count; i++) {
objFile = Request.Files[i];
if (objFile.FileNa me != "") {
strFileName = objFile.FileNam e;
strFileName = strFileName.Sub string(strFileN ame.LastIndexOf ("\\")+1);
try {
objFile.SaveAs( propertyPath+st rFileName);
System.Drawing. Image image =
System.Drawing. Image.FromFile( propertyPath+st rFileName);
System.Drawing. Image thumbImage =
image.GetThumbn ailImage(Conver t.ToInt32(100), Convert.ToInt32 (75),null,IntPt r.Zero);
image.Dispose() ;
thumbImage.Save (thumbnailPath+ strFileName, ImageFormat.Jpe g);
iString = ""+i+"";
uploadArray[i] = strFileName;
strMessage+= "Uploaded: "+strFileName+" <br>";
}
catch (Exception err) {
strMessage+= "Failed uploading "+strFileName+" :
"+err.ToString( )+"<br>";
}
}
}

uploadPhoto1Loc al = uploadArray[0];
uploadPhoto2Loc al = uploadArray[1];
uploadPhoto3Loc al = uploadArray[2];
uploadPhoto4Loc al = uploadArray[3];
uploadPhoto5Loc al = uploadArray[4];
uploadPhoto6Loc al = uploadArray[5];

MC_propertyPhot o1Hidden.Text = uploadPhoto1Loc al;
MC_propertyPhot o2Hidden.Text = uploadPhoto2Loc al;
MC_propertyPhot o3Hidden.Text = uploadPhoto3Loc al;
MC_propertyPhot o4Hidden.Text = uploadPhoto4Loc al;
MC_propertyPhot o5Hidden.Text = uploadPhoto5Loc al;
MC_propertyPhot o6Hidden.Text = uploadPhoto6Loc al;

return strMessage;
}
....

The page returns no errors and doens't perform the 'return strMessage;' as
it used to.

Thanks for your help.
Aug 26 '05 #1
0 1026

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

Similar topics

3
11753
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a table in MySQL with the path & filename to the image. I have successfully uploaded and performed an update query on the database, but the problem I have is I cannot retain the primary key field in a variable which is then used in a SQL update...
0
210
by: grahamhe | last post by:
Hi, I have recently upgraded .NET from 1.0 to 1.1 and now an application I am writing is no longer uploading the files, any ideas? I have posted the relevant code below... <%@ Page Language="C#" %> <%@ Import Namespace="System.IO" %> <%@ Import Namespace="System.Drawing" %> <%@ Import Namespace="System.Drawing.Imaging" %>
2
1779
ak1dnar
by: ak1dnar | last post by:
Hi, Future Photo is using Basic uploader and advanced uploader to upload images to there albums, My question is how to build up this kind of advanced uploader in php. As i feel its related with activeX object, any one having a Idea about this? Please Log to Future photo using this if don't like to get register and make sure to IE to browse the web for FF the advanced uploader is not getting. I think you have to download a ActiveX control...
2
1314
by: harikrishnan4u | last post by:
How can we check the image size in rad uploader this file uploader is in the rad editor??any one Know
0
8305
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
8732
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...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7324
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
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
4302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1953
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.