Solved

Upload a file from a subdomain to the main domain

Posted on 2008-10-02
10
263 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

23 Experts available now in Live!

Get 1:1 Help Now