Solved

Upload a file from a subdomain to the main domain

Posted on 2008-10-02
10
265 Views
Last Modified: 2012-05-05
I want users to be able to upload pictures from a subdomain to a folder on the mail domain.  II am trying to set up my own web server using window 2003. It works on the current sever the site is on but I cannot get it to work on the new server. The code is attached.  The code works on the other server so I'm wondering if it is a windows or firewall issues.  I've look at both but cannot figure out how to get it to work.:

Thanks,

Scott

Dim MyUploader

												Set MyUploader = New FileUploader

																			

												MyUploader.Upload()

														

												Dim File

												Dim myFile

												Dim msErrorMsg ' holds error message if any variables are blank

	

												msErrorMsg = ""

								

												For Each File In MyUploader.Files.Items

													File.FileName=Left(File.FileName,Len(File.FileName)-4) & "(" & request.Cookies("userID") & ")" &  Right(File.FileName,4)

													myFile = File.FileName 

													'response.Write("<br>" & File.FileSize)

													if File.FileSize > 5242880 THEN

														msErrorMsg = "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Sorry, the picture is too big, please resize and try again!<br>"

								

														If InStrRev(msErrorMsg, "<br>") <> Len(msErrorMsg) - 6 Then

															msErrorMsg = msErrorMsg & "<br>"

														End If

				

														'Set the Session error msg for display after redirect

														Session("msErrorMsg") = msErrorMsg		

														Session("Corrections") = "Yes"

																

														Response.Redirect("myAccount.asp?view=purchaseAd&action=uploadPic")

													END if

													response.Write("<br>" & File.ContentType)

												NEXT

																						

												sql="SELECT * FROM users WHERE userID=" & request.Cookies("userID") & ""

												set rs=Conn.Execute(sql)

												response.Write(myFile)	

												

												For Each File In MyUploader.Files.Items

													File.SaveToDisk "C:\pathtofolder\images\banners\"

												Next
 

...

Open in new window

0
Comment
Question by:judoscott
  • 6
  • 4
10 Comments
 
LVL 10

Accepted Solution

by:
slamhound earned 245 total points
ID: 22630336
When you say it doesn't work, what do you mean? How far do you get? Do you get any error messages?

Make sure that the FileUploader is installed, can write to the upload directory and has administrator rights on the new machine. You can limit it's rights once you've got things working.
0
 

Author Comment

by:judoscott
ID: 22630757
It acts as if it is working but when I log onto the machine through remove desktop the file is not there.  How do I give the file uploader administrative rights?

Thanks,

Scott
0
 
LVL 10

Expert Comment

by:slamhound
ID: 22630887
Sounds like we're on the right track then. The file is uploaded but the uploader/IIS doesn't have the rights to save it to the folder.

The user is usually called something like IUser and is the same one IIS uses for it's system things. But it all depends on how your uploader is configured.
0
 

Author Comment

by:judoscott
ID: 22630936
I gave the IUSR admin right but it still isn't working.   I'm not sure how to check the configureation of the uploader.  Do you mean the upload.asp file or the MyUploader function?

Thanks,

Scott
0
 
LVL 10

Expert Comment

by:slamhound
ID: 22631036
I mean the FileUploader com object. There needs to be something installed on the server to be able to upload files. Whatever this is, it needs to have the appropriate run and access rights.

If it's on the server but not running, it might have to be registered using:
regsvr32 <full path and filename of the dll>
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:judoscott
ID: 22631042
I was able to upload to the subdomain just not to the main domain from the subdomain.  Wouldn't that mean it is installed and registered?  
0
 
LVL 10

Expert Comment

by:slamhound
ID: 22631374
If you are able to upload anything on that comptuer then yes, it's registered and working.

I'm now confused about the domain/subdomain thing. What is the domain and what is the subdomain?
0
 

Author Comment

by:judoscott
ID: 22643324
The domain is currently an IP address.  I'm trying to get the site up and running before I move it over but the way it works on the live site is that when users register on the register.tellyourtestimony.com the user uploads an image to the domain www.tellyourtestimony.com.

Scott
0
 

Author Comment

by:judoscott
ID: 22646421
Hey,
I just checked and I guess I had given the users on the main domain write permissions and not on the sub-domain.  I just tried it on the sub-domain and it now works.  Sorry for wasting your time.  I'll give you the points since you gave me things to check and if the uploader had not be registered I would have had to go that route and for your time!

i appreciate it.

Scott
0
 

Author Closing Comment

by:judoscott
ID: 31502570
Thanks again for your help!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

First of all, clustering IIS is something you should rarely consider doing. In almost all cases, Microsoft Network Load Balancing (NLB) (http://technet.microsoft.com/en-us/library/cc758834(WS.10).aspx) is a much better solution when you need to p…
What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now