Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
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
Medium Priority
?
243 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 53

Accepted Solution

by:
Scott Fell,  EE MVE earned 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

705 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