[Closed] Script to arcive and mail?
Hi everyone.
Anyone knows how to create a script (or already created) that allows to create the normal file/arcive and send it via mail or ftp n a page that requires to login?
For example: i want to upload a 3d project to any ftp service (renderfarm or bakup) and i need to register to upload the file…there is a way to do this from 3d max with a script?
DosCommand
ShellLaunch
and
HiddenDOSCommand
This is going to be a command line action not a max action.
Unless you use .net somehow.
you’ll also have to write your own max file archiver, unless I missed a max file archive command outside of “max file archive” that lets you specify the filename
Hi,
on a quick note here’s the starting code:
dotnet.loadAssembly "System.Net"
dotnet.loadAssembly "System.IO"
arDir = getdir #archives
theFile = "test_upload"
theArc = #((arDir+@"\"+theFile+".max"))
theZip = maz (arDir+@"\"+theFile+".zip") theArc
theZip = (arDir+@"\"+theFile+".zip")
theRemote=@"ftp://ftp.uploads.com/"+theFile+".zip"
clsRequest = (dotnetClass "System.Net.FtpWebRequest").Create theRemote
clsRequest.Credentials = dotnetObject "System.Net.NetworkCredential" "username" "password"
--wrMethods = dotnetclass "System.Net.WebRequestMethods"
clsRequest.Method = "STOR"
bFile = (dotnetClass "System.IO.File").ReadAllBytes theZip
clsStream = clsRequest.GetRequestStream()
clsStream.Write bFile 0 bFile.Count
clsStream.Close()
clsStream.Dispose()
At this stage this only zips one file (the max file defined in theFile variable, we need to write a custom archive method like ZeBoxx said). The upload seems to be working fine.
Either way, wouldnt it be easier to archive the files using Max default archive and uploading the files with an ftp client?..
Thanks guys…that was so helpfull…but i´m stuck here.
What i want to do is an automated system that creates the archive and upload the file to a ftp service…that askme for user/password, something like rebusfarm works with the “Farminizer”.
Kameleon,
What are you learning all of Dot NET from? I’m looking for some good .net resources, and I’ve looked through all of the ones in the sticky-ed thread, any others you suggest?
Hi Colin,
There’s really nothing special about it, I have a Visual Basic background and my two main resources are MSDN and lot of googling.
Cheers and if there’s anything I can help, just ask.
Thanks! I’m playing around with listview right now, and it’s not too hard, I just find myself trying to find methods and properties with little success…For instance figuring out how to Delete all the Listview items was challenging and with alot of guess work! How do you go about finding the props and methods for things like that?
-Colin
Have you seen these tutorials on my site?
Hey, I go to MSDN and I do alot of debbuging in my scripts by doing showmethods and showproperties, check out the Maxscript help for dotnet. You can even use dotnet.showconstructors “System.Windows.Forms.ListView” for example to see how to create a listview or anything you want! Cheers.