?
Solved

upload file in asp.net

Posted on 2010-01-02
10
Medium Priority
?
256 Views
Last Modified: 2012-05-08
i create subdomain admin.mywebsite.com
i want to upload file
from this domain to my main domain
www.mywebsite.com 's image folder
how i do this
0
Comment
Question by:chandresh43
  • 3
  • 3
  • 3
  • +1
10 Comments
 
LVL 11

Accepted Solution

by:
govindarajan78 earned 1000 total points
ID: 26161280
1 . store the absolute path ex(d:\site\mainsite\images) in the upload program

you also can store that path in the web.config

2. if the sites are in different machine then you have to write program to post the image to the to main site and from main site read and store the value
0
 
LVL 5

Author Comment

by:chandresh43
ID: 26161286
where i find this path
i make not hosting
my website on host server
what is default path that i save
0
 
LVL 11

Expert Comment

by:Muhammad Ousama Ghazali
ID: 26161398
Contact your web hosting company and ask for this information such as Absolute Path to your Main and Sub Domain and try using it as suggested by govindarajan78.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Author Comment

by:chandresh43
ID: 26161493
I TRY IT BUT IT GIVE ME ERROR
c:/Inetpub/vhosts/MYDOMAIN/httpdocs/images/Diamond-Ring/Engagement-Ring/
IS NOT not a valid virtual path.
0
 
LVL 11

Expert Comment

by:Muhammad Ousama Ghazali
ID: 26161525
1. Try putting "\" instead of "/" in your path.
2. Please post the full actual error message/detail you get to have a better assitance.
0
 
LVL 11

Assisted Solution

by:Muhammad Ousama Ghazali
Muhammad Ousama Ghazali earned 1000 total points
ID: 26161527
3. Confirm with your hoster if the Network Service and/or ASPNET user have the Write/Modify permissions on that folder?
0
 
LVL 11

Expert Comment

by:govindarajan78
ID: 26161636
print the server.mappath in the subdomain ; that will show the physical path
0
 
LVL 5

Author Comment

by:chandresh43
ID: 26161810
it show c:/Inetpub/vhosts/MYDOMAIN/httpdocs
this path
0
 
LVL 29

Expert Comment

by:Kumaraswamy R
ID: 26163679
Hi

My suggestion

step 1: in the web.config file give the File Path

step 2: In the Server side get / Read the file path information from the Web.config
 
step 3: Check the folder exist , else create

Step 4: Save the File

Sample coding


                    if (!System.IO.Directory.Exists(sPath))
                        System.IO.Directory.CreateDirectory(sPath);
                    if (btnFileBrowse.Value != "")
                                string path = sPath + sPDF_FileName + fileextension;
                    btnFileBrowse.PostedFile.SaveAs(path.ToString());
                                        FileUploadstatus = "Success";
                   
0
 
LVL 11

Expert Comment

by:govindarajan78
ID: 26166162
before proceeding:
check
what
moghazali said

moghazali:
3. Confirm with your hoster if the Network Service and/or ASPNET user have the Write/Modify permissions on that folder?
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question