Save A Picture In One Folder Up From There Where Call The Mappath?
Mar 28, 2011
i want to save a picture in one folder up from there where i call the mappath how can i do that?
for example i am here
c:usersmevstproject
and i want to save the file here
c:usersmevst
i want to do that with mappath in order to work in the server.not only in my pc..
View 9 Replies
Similar Messages:
Feb 8, 2011
i'm new to c# and i wanted to know how can i allow user to upload a picture from a text box and a button??
after uploading the picture, how can i save the picture in the database??
**note**the picture i allow user to upload need to be in a fixed size.
View 4 Replies
Aug 6, 2010
When my ASP.NET site uses documents (e.g. XML), I normally load the document as follows:
Server.MapPath("~DocumentsMyDocument.xml")
However, I would like to move the Documents folder out of the website folder so that it is now a sibling of the website folder. This will make maintaining the documents considerably easier.
However, rewriting the document load code as follows:
Server.MapPath("../../Documents/MyDocument.xml")
results in a complaint from ASP.NET that it cannot 'exit above the top directory'.
how I can relatively specify the location of a folder outside the website folder? I really don't want to specify absolute paths for the obvious deployment reasons.
View 4 Replies
Sep 23, 2010
What is the difference between those two? If I only want to retrieve the absoluate path to an image on web server, is Server.MapPath safer in any case? I'm using Page.MapPath right now, but it won't work if control was created in WebService since control.Page property become null? Whether Server.MapPath always work?
View 1 Replies
Oct 17, 2010
I have a folder with pictures (EmpID.jpg).... When datagrid is returned containing an EmpID, name, address, etc... I want to get the matching picture from folder which resides on server not located within the application itself.
View 3 Replies
Mar 17, 2010
I had write a code about get a picture from url and save as bitmap. However, there was a problem in HttpWebResponse. It didn't run the code start from HttpWebResponse.Then my whole website die there.
[Code]....
View 8 Replies
Oct 26, 2010
If i want to create a web site that take your picture and share it for your friends, what the best way to save the picture files on server? What the way is safer for the picture files? What the way has the best performance?
View 9 Replies
Feb 6, 2011
Using C#
How can i save a Div (tabel) in .aspx page as a Pic (jpeg or anything) ?
View 2 Replies
Mar 18, 2013
I am uploading images in c# windows application. I am uploading the images folder wise. In one folder there are 200 to 3000 images. My one images size is about 3.10 MB to 6.2 MB. Its dimensions are 3008 x 1960, 1960 , 4000 x 2600. 6000 x 4000 . while uploading i am reducing the size of image to 400 x 266 or 266 x 400 depending on the height and width of image. but still my image size is about 227 KB. Now i want to reduce the image resolution to decrease the image size.
My code is given below:
private void btnUpload_Click(object sender, EventArgs e)
{
getDestinationPath();
string ik = DestinationPath;
string ik2 = DestinationPath2;
string lastFolderName = Path.GetFileName(ik);
[Code] .....
View 1 Replies
Feb 16, 2011
i have a master page in a root and some pages in root and works perfectly, but now i need a different folder (secure) and in this folder i have an Admin page but doesnt show icons from master, only the placeholder. If i change the url from .css (url('images/page-bgglare.png') to (url('../images/page-bgglare.png') works the pages inside the folder but doesnt works the pages in root.
View 4 Replies
May 7, 2015
How To Save Video files into folder and save path only into database in asp.net using c#.
View 1 Replies
Oct 28, 2010
i help save image as picture in sql databases for consumer profile now i possess a site that sow consumer profile facts an im this site i possess a picture manage to display consumer avatar with. in code at the rear of with Userprofile.Avatar code i obtained the picture as byte
View 4 Replies
May 7, 2015
I obtained the facebook profile details of an user.Now I need to store the profile details including profile picture in my local database.
View 1 Replies
Jan 4, 2014
What is the best way to insert and retrieve images like :
In the database in binary form retrieve it with imagehandler, or
In the database by saving the path of the folder of the images and retrieve it, or
by saving the images directly to the folder and retrieve it...
View 1 Replies
Dec 23, 2010
I have this code to insert a picture from database into an ImageControl on my ASP.NET form:
strConnString = "server=" + Server + ";database=" + DataBase + ";UID=" + UID + ";password=" + PASS + ";";SqlConnection MyConnection = new SqlConnection(strConnString);SqlCommand MyCommand = new SqlCommand("SELECT Pic FROM MEN WHERE ID=5", MyConnection);MyConnection.Open();SqlDataReader MyReader = MyCommand.ExecuteReader();if (MyReader.Read()){ byte[] m_MyImage = (byte[])MyReader["Pic"]; Response.BinaryWrite(m_MyImage);}
And I have this ImageControl on the form:
<asp:Image Width="88" Height="100" Runat="server" ID="m_Image" NAME="m_Image" />
but when I run the code, I see the picture big on the screen and not in my ImageControl.
i also put this in the form_load:
m_Image.ImageUrl = "MyPhoneBook.aspx?m_Image";my control is: m_Imagemy control ID is: m_Imagemy namespace is MyPhoneBook
but still dont work
View 5 Replies
Dec 28, 2010
I want to load a image in drive in images folder.I created one folder in the d drive by the name Images
In button save event...
string path = ConfigurationManager.AppSettings["LoadImage"].ToString();
In Web Config why is this not working
<add key="LoadImage" value="D:Images"/>
View 8 Replies
Aug 17, 2010
i m using asp.net 2005 with access 2003. with the fileupload control, i can store the vlc player in my folder by using tis code
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
If FileUpload1.HasFile Then
FileUpload1.SaveAs(Server.MapPath("upload/" & FileUpload1.FileName))
Label1.Text = FileUpload1.FileName.ToString
con.Open()
Dim dat As String
dat = Now()
Dim cmd As New OleDbCommand("insert into filenms values('" & Label1.Text & "','" & dat & "' ) ", con)
MsgBox("Updated")
Try
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox("type correct Text and not updated")
End Try
End If
End Sub
but it is showing me " The page cannot be displayed ". how can i store
View 4 Replies
Feb 9, 2010
I want to save file in particular folder .
how can i do this ?
View 3 Replies
May 7, 2015
in my asp.net i need to convert httppostedfile to bmp or image format.how to convert this.am getting posted file from fileupload control.
Session["File"] = FileUpload1.PostedFile;
View 1 Replies
Nov 26, 2012
I need the following in c#.net
I need to save around 12 excel at a time in a particular folder in c#.net.
View 1 Replies
Jan 17, 2013
how to zip the folder and ask for the open save prompt in c#.net
View 1 Replies
May 7, 2015
I used below code for uploading image and show in image control with thumpnail metod for reducing image size:
protected void BtnUpload_Click(object sender, EventArgs e)
{
string path = Server.MapPath(".") + "../image/House/product";
string filename = System.IO.Path.GetFileName(fup1.PostedFile.FileName);
string[] validext = { ".jpg", ".png" };
string ext = System.IO.Path.GetExtension(fup1.PostedFile.FileName);
if (Array.IndexOf(validext, ext.ToLower()) < 0)
[Code]...
It save original image in host, now I want it save image that reduce size with GetThumpnail metod in other place How I can do it?
View 1 Replies
May 25, 2010
I m uploading a file and reading it. The problem is I dont want to save that file in a folder which is in my solution explorer. I want to save it in a different Drive. I m saving the file in a different drive using web.cofig <add key="UploadFileLocation" value="C:\VOL0\Upload\"/> and I m saving using code FileUpload1.PostedFile.SaveAs(ConfigurationManager.AppSettings["UploadFileLocation"] + SaveLocation); all goes fine, but I m reading the file and it is throwing an exception when I m trying to read file.
View 3 Replies
Jul 1, 2010
I had a code that creates a snapshoot of website and store the snapshoot in a specified folder.When I deployed the app into production server, it creates the image but it does not appear or stored in the specified folder, how I can fix this proble, I wan the snapshoot to be stored in the specified folder when hte app is on the production server .
Code Used to make a snapshoot is attached:
[URL]
View 2 Replies
Aug 13, 2010
Currently i have done upload image function and its saved the picture into folder in server . But if the picture has same name its unable to save the photo . How to rename the photo each time i save the photo into the server . Below is my coding .
<asp:FileUpload ID="FileUpload1" runat="server" />
<input type="button" id="btnUpload" runat="server" value="UploadPhoto" onserverclick="btnUpload_Click" />
protected void btnUpload_Click(object sender, EventArgs e)
[Code]....
View 9 Replies