Solved

Upload a file from a subdomain to the main domain

Posted on 2008-10-02
10
270 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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
 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

828 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