How to upload images to portfolio using a landing page, I tried the following but it is only taking in from an URL but not from the local machine. Could anyone guide me on how to achieve this?
Processing page:
%%[
SET @Image = RequestParameter("fileToUpload")
SET @PortfolioObject = CreateObject("Portfolio")
SetObjectProperty(@PortfolioObject, "DisplayName", GUID())
SetObjectProperty(@PortfolioObject, "CustomerKey", GUID())
SetObjectProperty(@PortfolioObject, "FileName", "example.png")
SET @ClientID = CreateObject("ClientID")
SetObjectProperty(@ClientID, "ID", "xxxxxxx")
SetObjectProperty(@PortfolioObject, "Client", @ClientID )
SET @ResourceSpecification = CreateObject("ResourceSpecification")
SetObjectProperty(@ResourceSpecification, "URN", @Image)
SetObjectProperty(@PortfolioObject, "Source", @ResourceSpecification)
SET @StatusCode = InvokeCreate(@PortfolioObject, @StatusMsg, @ErrorCode)
]%%
%%=v(@StatusCode)=%%
HTML page:
<!DOCTYPE html>
<html>
<body>
<form action="" method="post" enctype="multipart/form-data">
Select image to upload:
<input type="text" name="fileToUpload" id="fileToUpload" size="50"> <br/><br/>
<input type="submit" value="Upload Image" name="submit">
</form>
</body>
</html>