Image upload for Development, Test and Live?

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
7/2/2008 10:38:21 AM
Gravatar
Total Posts 112

Image upload for Development, Test and Live?

Hi All;

I upload images to a mojoPortal folder under Data (D:\webs\MW\pub\mojoPortal\Data\pix) on my Live website. This works lovely and I'm delighted with it; but, I'd like to see the same images when developing, and when testing. For a while I xcopy-ed the folder tree to development; but, I have more than 9 GB of images now and copying it around is tedious.

I'm using this to upload the images:

String pathPix = "Data/pix/2"; // 1o original, 1t thumbnails, 1r regular size.
FileUpload1.PostedFile.SaveAs(Server.MapPath(pathPix + "o/" + temptext));
String MyString = ImageReSizeAndSave(Server.MapPath(pathPix + "o/" + temptext));  //Standardize image in r/ from o/.

And I save the reference in SQL like this:

imageURL = "~/" + pathPix + "r/" + MyString;
SqlDataSourcePI.InsertParameters["PartImageLocation"].DefaultValue = imageURL;
 

I'm wondering if there's a way I can point at the Live image paths when running in the Development and Test environments.

Or perhaps there's a way to make the MSDOS, or Windows OS levels have Development and Test point at the Live folders. Were I running Linux or Unix I might mount that folder, or create a link.

Any thoughts you have are very much appreciated,
Dale E. Moore

7/2/2008 11:04:40 AM
Gravatar
Total Posts 18439

Re: Image upload for Development, Test and Live?

Hi Dale,

9 GB is a lot of files. I think what I would do is write a vb script and set it up as a scheduled task. The script would have to run as a user with at least read permission on the production drive and write permission on the development drive. I would have the script run from the dev machine. The script would ideally iterate through the files on the production drive and just copy over to dev missing files or files with a newer timestamp. You can probably google and find example vb script files that have file system sync code you could use or modify. Or you could just manually execute the script from time to time when you want to sync.

I'd also setup a sql task to backup the production db and restore it on dev peridically.

Hope it helps,

Joe

7/2/2008 11:25:29 AM
Gravatar
Total Posts 112

Re: Image upload for Development, Test and Live?

Thanks for the thoughts on the copy scheduled task!

Development, Test and Live; 3 times 9 GB and growing... I'm a sad boy:(

Would I be foolish to look into keeping the images inside the SQL database thus giving access to all 3 environments?

You must sign in to post in the forums. This thread is closed to new posts.