Solved

Looking for a solution to sync or otherwise an image folder that is uploaded to by clients in a Staging server and mirrored or copied to the Production website.

Posted on 2014-11-11
4
187 Views
Last Modified: 2014-12-17
Hello Experts,

I have a client that uploads blog images via the DMZ in a STAGING server ( using an ASP Upload DMX plugin ) however I would like that folder mirrored to the PRODUCTION website.

In order for me let the, use the form to upload to the STAGING server , I had to give that Internet Account in Security to modify so that it can upload the images.
Of course I cannot give the Internet account on the PRODUCTION website anything more than read.
Thus my dilemma.
I am not a wizard so any viable solution would be greatly appreciated!

Thank you in advance,

Using ASP Classic, VBScript, Windows 2008 Server , both servers are in the DMZ with the same domain.
0
Comment
Question by:colonelblue
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 2

Expert Comment

by:Glen Richmond
ID: 40436835
can you give a specific application special permission and write your own sync app (ASP.Net/C#/VB.Net?) to run in the background (CGI?) being called everytime a file is copied to the STAGING area to copy to the PRODUCTION area?
0
 

Author Comment

by:colonelblue
ID: 40438474
:( As I'm mentioned , I'm not a wizard,
0
 
LVL 33

Expert Comment

by:Big Monty
ID: 40440141
Of course I cannot give the Internet account on the PRODUCTION website anything more than read.

makes sense. what about creating a different internet account that has read/write access ONLY on this particular site? or are you uncomfortable giving ANY account that kind of access?

if that's the case, you may better off writing a vbs script that runs under Scheduled Tasks, and does that file transfer directly that way
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 40441798
Why not just run it as a vbscript (save the file as a .vbs) and have your scheduled task run on the production server.

Taking the save example from http://www.webresizer.com/app/demos/code/asp.html
imagename = request("fileName")
url = request("url")
 
'Creating variables
 
imageUrl = url 
strImageName = imagename
 
'Function and subroutine calls
 
saveImage getImage(imageUrl), strImageName
 
'Here is code library:
 
Function getImage(strImageUrl)

  ' Set objHttp = CreateObject("Microsoft.XMLHTTP")
  ' Set objHttp = CreateObject("MSXML2.ServerXMLHTTP")
  Set objHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
  ' Set Http = CreateObject("WinHttp.WinHttpRequest")
  objHttp.Open "GET", strImageUrl, False
  objHttp.Send
            
  getImage = objHttp.ResponseBody

End Function
 

Sub saveImage(ByteArray, strImageName)

  Const adTypeBinary = 1
  Const adSaveCreateOverWrite = 2
  Const adSaveCreateNotExist = 1
            
  Set objBinaryStream = CreateObject("ADODB.Stream")
  objBinaryStream.Type = adTypeBinary
            
  objBinaryStream.Open
  objBinaryStream.Write ByteArray
  objBinaryStream.SaveToFile server.mappath("images\" & strImageName) , 
      adSaveCreateOverWrite
  response.Write("Image has been downloaded and saved!")

end sub

Open in new window


On the production server, you just need to read which files are available, then  loop through those files, read the url where they are from and save.    Running this as a vbs file means you don't have to give permissions to the internet user account

For the first part, you need to read what is available.  Your upload script on the staging server can generate a file that lists the urls of images.  If you want to add a little security to that page.
if request.querystring("passcode")="some_long_pass_code" then
    response.write "<img src='/images/someimage.jpg'>"
    response.write "<img src='/images/someimage.jpg'>"
end if

Open in new window

That will list the images on the staging server.  Then you can loop through the images and save them using the first bit of code with some modification of course.

Check out aspupload http://www.aspupload.com/manual_security.html there is a way where you can set a password on a folder and aspupload can submit that info.


Why make it difficult for yourself.  Why not make one folder on the production server able to accept an image from your image upload simultaneously.   You can set an obscure folder with the write permissions, then once there, use fso to move it to the images folder.
0

Featured Post

Technology Partners: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA Vbscript  Issue 9 33
IIS 7 and executing pages using localhost 16 24
Send form to asp server side 6 26
How to post data to an API using ASP Classic 3 26
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

740 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