hi,
i am uploading .doc,.docX,rtf files during registration level and that path can be saved in database(i am using database MYSQL).when user want to see his resume he/she can login and retrive his details by clicking on retrive button.my problem is the code will be working in local system it not working in server.i am attaching my code shown below - using System;
-
using System.Data;
-
using System.Configuration;
-
using System.Collections;
-
using System.Web;
-
using System.Web.Security;
-
using System.Web.UI;
-
using System.Web.UI.WebControls;
-
using System.Web.UI.WebControls.WebParts;
-
using System.Web.UI.HtmlControls;
-
using Microsoft.Office.Interop;
-
using System.IO;
-
using System.Reflection;
-
-
#endregion
-
-
public partial class ResUploadOrCompDesc : System.Web.UI.Page
-
{
-
#region "Global Variables "
-
-
DataAccess ObjDA;
-
-
#endregion
-
-
#region "Page_Load "
-
-
protected void Page_Load(object sender, EventArgs e)
-
{
-
try
-
{
-
string UName = "";
-
string TblType = "";
-
ObjDA = new DataAccess();
-
lblErrMsg.Text = "";
-
-
if (!IsPostBack)
-
{
-
Session["MyAccount"] = "false";
-
if (Session["UserName"] == null)
-
Response.Redirect("Home.aspx");
-
else
-
{
-
UName = Session["UserName"].ToString();
-
-
if (Session["TblType"] != null)
-
TblType = Session["TblType"].ToString();
-
-
Session["MyPhoto"] = "~/UserPhotos/" + UName + @"\" + ObjDA.GetScalarValues(TblType + "MyAcc", "", "username='" + UName + "'");
-
-
if (TblType == "PRD4")
-
{
-
imgbtnGetResInfo.Visible = false;
-
fudResume.Visible = false;
-
lblUpload.Visible = false;
-
lblValMsg.Visible = false;
-
txtResume.Text = ObjDA.GetScalarValues(TblType, "compdesc", "username='" + UName + "'");
-
}
-
else
-
{
-
imgbtnGetResInfo.Visible = true;
-
fudResume.Visible = true;
-
lblUpload.Visible = true;
-
lblValMsg.Visible = true;
-
}
-
//if (IsPostBack)
-
//{
-
// if (Request.Form["hid_f"] == "1") //if user clicks "OK" to confirm
-
// {
-
// int i = 0;
-
// Request.Form["hid_f"].Replace("1", "0");
-
// i = ObjDA.InsertOrUpdateOrDeleteData(TblType, "", UName, "D");
-
// ObjDA.InsertOrUpdateOrDeleteData("Ref", "", Session["a"].ToString(), "D");
-
// if (i == 1)
-
// {
-
// MsgBox1.alert("Account deleted sucessfully");
-
// Response.Redirect("home.aspx");
-
// }
-
// else
-
// {
-
// MsgBox1.alert("Unable to delete the selected record and try again");
-
// }
-
// }
-
//}
-
}
-
}
-
}
-
catch (Exception ex)
-
{
-
lblErrMsg.Text = ex.Message;
-
}
-
finally
-
{
-
if (ObjDA != null)
-
ObjDA = null;
-
}
-
}
-
-
#endregion
-
-
#region "imgbtnGetResInfo_Click "
-
-
protected void imgbtnGetResInfo_Click(object sender, ImageClickEventArgs e)
-
{
-
try
-
{
-
string UName = "";
-
string TblType = "";
-
string ResumeFilePath = "";
-
ObjDA = new DataAccess();
-
-
if (Session["UserName"] != null)
-
UName = Session["UserName"].ToString();
-
if (Session["TblType"] != null)
-
TblType = Session["TblType"].ToString();
-
-
//Request.Form["hid_f"].Replace("1", "0");
-
-
ResumeFilePath = AppDomain.CurrentDomain.BaseDirectory + @"UserResumes\" + UName + "\\" + ObjDA.GetScalarValues(TblType, "resume", "UserName='" + UName + "'");
-
-
if (File.Exists(ResumeFilePath))
-
{
-
Microsoft.Office.Interop.Word.ApplicationClass wordApp = new Microsoft.Office.Interop.Word.ApplicationClass();
-
object FileName = ResumeFilePath;
-
object nullobj = System.Reflection.Missing.Value;
-
Microsoft.Office.Interop.Word.Document DocOne = wordApp.Documents.Open(ref FileName, ref nullobj, ref nullobj,
-
ref nullobj, ref nullobj, ref nullobj,
-
ref nullobj, ref nullobj, ref nullobj,
-
ref nullobj, ref nullobj, ref nullobj,
-
ref nullobj, ref nullobj, ref nullobj, ref nullobj);
-
-
Microsoft.Office.Interop.Word.Document DocTwo = wordApp.ActiveDocument;
-
txtResume.Text = DocTwo.Content.Text;
-
DocOne.Close(ref nullobj, ref nullobj, ref nullobj);
-
}
-
else
-
{
-
lblErrMsg.Text = "No File Uploaded";
-
}
-
}
-
catch (Exception ex)
-
{
-
lblErrMsg.Text = ex.Message;
-
}
-
finally
-
{
-
if (ObjDA != null)
-
ObjDA = null;
-
}
-
}
-
-
#endregion
-
-
#region "imgbtnUpdateResume_Click "
-
-
protected void imgbtnUpdateResume_Click(object sender, ImageClickEventArgs e)
-
{
-
try
-
{
-
int FilesCount = 0;
-
string UName = "";
-
string TblType = "";
-
string DirName = "";
-
int i = 0;
-
ObjDA = new DataAccess();
-
-
if (Session["UserName"] != null)
-
UName = Session["UserName"].ToString();
-
if (Session["TblType"] != null)
-
TblType = Session["TblType"].ToString();
-
-
DirName = AppDomain.CurrentDomain.BaseDirectory + @"UserResumes\" + UName;
-
-
if (imgbtnGetResInfo.Visible == true)
-
{
-
if (Directory.Exists(DirName) == false)
-
Directory.CreateDirectory(DirName);
-
else
-
{
-
FilesCount = Directory.GetFiles(DirName).Length;
-
if (FilesCount > 0)
-
{
-
for (int j = 0; j < FilesCount; j++)
-
{
-
if (File.Exists(Directory.GetFiles(DirName)[j].ToString()))
-
File.Delete(Directory.GetFiles(DirName)[j].ToString());
-
}
-
}
-
}
-
-
fudResume.SaveAs(DirName + @"\" + fudResume.FileName.ToString());
-
-
ObjDA.InsertOrUpdateOrDeleteData(TblType, "resume=''", "UserName='" + UName + "'", "U");
-
i = ObjDA.InsertOrUpdateOrDeleteData(TblType, "resume='" + fudResume.FileName.ToString() + "'", "UserName='" + UName + "'", "U");
-
-
if (i == 1)
-
{
-
lblErrMsg.Text = "Resume uploaded successfully";
-
txtResume.Text = "";
-
}
-
}
-
else
-
{
-
ObjDA.InsertOrUpdateOrDeleteData(TblType, "compdesc=''", "UserName='" + UName + "'", "U");
-
i = ObjDA.InsertOrUpdateOrDeleteData(TblType, "compdesc='" + txtResume.Text + "'", "UserName='" + UName + "'", "U");
-
if (i == 1)
-
lblErrMsg.Text = "Company Description updated successfully";
-
}
-
-
}
-
catch (Exception ex)
-
{
-
lblErrMsg.Text = ex.Message;
-
}
-
finally
-
{
-
}
-
}
-
-
#endregion
-
(***here is no server problem*****)ca n any one help me plzzzz
3 2938
hi,
i am uploading resume in registration levels.the user want to see his/her resume he/she can login and click on 'getresume' button all the information could be displayed in multiline text box.my problem is it will be working on local system when we are hosting the resume will not be displayed. i am using my sql database.my code will be shown below -
#region "imgbtnGetResInfo_Click "
-
-
protected void imgbtnGetResInfo_Click(object sender, ImageClickEventArgs e)
-
{
-
try
-
{
-
string UName = "";
-
string TblType = "";
-
string ResumeFilePath = "";
-
ObjDA = new DataAccess();
-
-
if (Session["UserName"] != null)
-
UName = Session["UserName"].ToString();
-
if (Session["TblType"] != null)
-
TblType = Session["TblType"].ToString();
-
-
//Request.Form["hid_f"].Replace("1", "0");
-
-
ResumeFilePath = AppDomain.CurrentDomain.BaseDirectory + @"UserResumes\" + UName + "\\" + ObjDA.GetScalarValues(TblType, "resume", "UserName='" + UName + "'");
-
-
if (File.Exists(ResumeFilePath))
-
{
-
Microsoft.Office.Interop.Word.ApplicationClass wordApp = new Microsoft.Office.Interop.Word.ApplicationClass();
-
object FileName = ResumeFilePath;
-
object nullobj = System.Reflection.Missing.Value;
-
Microsoft.Office.Interop.Word.Document DocOne = wordApp.Documents.Open(ref FileName, ref nullobj, ref nullobj,
-
ref nullobj, ref nullobj, ref nullobj,
-
ref nullobj, ref nullobj, ref nullobj,
-
ref nullobj, ref nullobj, ref nullobj,
-
ref nullobj, ref nullobj, ref nullobj, ref nullobj);
-
-
Microsoft.Office.Interop.Word.Document DocTwo = wordApp.ActiveDocument;
-
txtResume.Text = DocTwo.Content.Text;
-
DocOne.Close(ref nullobj, ref nullobj, ref nullobj);
-
}
-
else
-
{
-
lblErrMsg.Text = "No File Uploaded";
-
}
-
}
-
catch (Exception ex)
-
{
-
lblErrMsg.Text = ex.Message;
-
}
-
finally
-
{
-
if (ObjDA != null)
-
ObjDA = null;
-
}
-
}
-
-
#endregion
-
-
#region "imgbtnUpdateResume_Click "
-
-
protected void imgbtnUpdateResume_Click(object sender, ImageClickEventArgs e)
-
{
-
try
-
{
-
int FilesCount = 0;
-
string UName = "";
-
string TblType = "";
-
string DirName = "";
-
int i = 0;
-
ObjDA = new DataAccess();
-
-
if (Session["UserName"] != null)
-
UName = Session["UserName"].ToString();
-
if (Session["TblType"] != null)
-
TblType = Session["TblType"].ToString();
-
-
DirName = AppDomain.CurrentDomain.BaseDirectory + @"UserResumes\" + UName;
-
-
if (imgbtnGetResInfo.Visible == true)
-
{
-
if (Directory.Exists(DirName) == false)
-
Directory.CreateDirectory(DirName);
-
else
-
{
-
FilesCount = Directory.GetFiles(DirName).Length;
-
if (FilesCount > 0)
-
{
-
for (int j = 0; j < FilesCount; j++)
-
{
-
if (File.Exists(Directory.GetFiles(DirName)[j].ToString()))
-
File.Delete(Directory.GetFiles(DirName)[j].ToString());
-
}
-
}
-
}
-
-
fudResume.SaveAs(DirName + @"\" + fudResume.FileName.ToString());
-
-
ObjDA.InsertOrUpdateOrDeleteData(TblType, "resume=''", "UserName='" + UName + "'", "U");
-
i = ObjDA.InsertOrUpdateOrDeleteData(TblType, "resume='" + fudResume.FileName.ToString() + "'", "UserName='" + UName + "'", "U");
-
-
if (i == 1)
-
{
-
lblErrMsg.Text = "Resume uploaded successfully";
-
txtResume.Text = "";
-
}
-
}
-
else
-
{
-
ObjDA.InsertOrUpdateOrDeleteData(TblType, "compdesc=''", "UserName='" + UName + "'", "U");
-
i = ObjDA.InsertOrUpdateOrDeleteData(TblType, "compdesc='" + txtResume.Text + "'", "UserName='" + UName + "'", "U");
-
if (i == 1)
-
lblErrMsg.Text = "Company Description updated successfully";
-
}
-
-
}
-
catch (Exception ex)
-
{
-
lblErrMsg.Text = ex.Message;
-
}
-
finally
-
{
-
}
-
}
-
(****there is no server problem its working fine***)
can any one help me plz
Hi,
If the application is working in localhost but not on webserver there can be these possibilites in my opinion:
1. You have not given access to read/write to the UserResumes directory. So the application is failing for writing the given resume.
2. Your Office components are not properly installed on the server.
Try to eliminate the above two. As far as I know, if server is working fine, client should not have any problem.
Frinavale 9,735
Recognized Expert Moderator Expert
What do you mean when you say your code is "not working" on the web server?
Is your website working but you are not able to upload files?
What is the error you are getting when you attempt to run the site on the web server?
If you have access to the web server, check the Windows Event Logs for any error messages generated by ASP.NET and please post them so that we have an idea of what's going on.
Do you have ASP.NET installed on the web server?
Is your web server configured to run your site with the same .NET Framework that your application was developed with?
Do you have all permissions set correctly?
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: jason |
last post by:
Is there a way to avoid On Error Resume Next for:
cnn.Open strCon
SQL = "EXEC Customer @txtEmail='" & email_address & "'"
set rs = cnn.execute(SQL)
'On error resume next
rs("email_address")
'// This record does not exist thus throwing up an error. I could use On
|
by: Ian DeRock |
last post by:
I'm fairly new to XML. As I can see it, XML is a way to organize data
like in a table in a RDB, or the RDB itself. I have used XML in
application data, but did not design the actual XML.
I have a background in both hardware and software. I want to create
an application that will regenerate a resume from the XML Resume that
I have. I would like some people to look over my XML Resume data and
give me suggestions on the XML. This...
|
by: Darta |
last post by:
OK- I volunteer to be shot if this question is stupid... BUT, is there
a way to, when you catch an exception in the catch{} handler, resume
to the same line of code that generated an error while you are
debugging within IDE...? Here is an example from VB:
Private SomeFunction ()
On Error GoTo ErrHandler:
MyMethod this, that
|
by: juky |
last post by:
Hi all,
I have a loop in the thread checking for a particular service status,
whenever the status changes to "stopped" a RaiseEvent is generated by
thread and another function runs. At the same time the thread is
suspended. When I try to resume it from the another function I have
some problems.
Thank you.
Juky
|
by: bob.needler |
last post by:
I know On Error Resume Next is generally considered lazy. But can
someone tell me why the resume next in Exit_Handler does not seem to
work? It generates the typical unhandled runtime error message from
Access. If I comment out the 1st On Error Resume Next and the x = 1 /
0 on the next line there is no difference, i.e. ther same unhandled
error on the same line. I included these 2 lines of code to
demonstrate that On Error Resume Next...
| |
by: fniles |
last post by:
In VB 6.0 in the error trapping, we can do "resume next" to continue on the
next code. How can we do that in .NET with "Try", "Catch","End Try" ?
Thanks
|
by: Neo |
last post by:
I found on error resume next doesn't work in for each... e.g.
on error resume next
for each x in y
'do stuff
next
if you have an error in for each loop, it falls in infinite loop... it
doesn't move to next element... this sad thing but, it's indication
that we must move to try catch instead of on error.
|
by: Maxwell2006 |
last post by:
Hi,
I know that this is not a good practice, but I wonder do we have "on error
resume next" in C#?
Thanks,
|
by: MMcCarthy |
last post by:
Organizing a Resume
Pertinent information included on your resume may be organized in a variety of ways. Regardless of the type of resume used, you should include the following:
Contact Information: Include your name (on every page), phone number, email, address, and postal code.
Objective: Address the positions that you are currently seeking.
Highlights: 5 or 6 points summarizing your career skills and abilities.
Work Experience: Be...
|
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...
|
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...
| |
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,...
|
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...
|
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...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |