This behaviour is normal.
Tridion keeps a list of all published multimedia components and their actual files on the file system.
If you would change the name of a file in the multimedia component and republish it, it will update this record, and remove any old files, and put the new file in place.
If this wouldn't happen, the server you publish to would be ...
The reason you are seeing this error is because you are creating a new Multimedia Component using the Create method. When creating a new multimedia component, it looks at the BinaryContent.UploadFromFile property to upload the binary from a file path. If you look at your compData.BinaryContent.UploadFromFile property, its actually not set, so you are just ...
A while back I've written a TBB that does exactly what you want, including checking if a Structure Group exists that mirrors the path of the Folder (based on relative WebDav paths).
Here is the link: http://www.tridiondeveloper.com/publish-an-image-to-a-structure-group-mirroring-folder
The setup is correct, and the rendered output is correct as well.
However, you will need to create some code to handle images stored in the DB by your webserver. Your webserver is not able to do this by default, and Tridion also doesn't have something like that out of the box.
I'm not sure if you are using DD4T or not. DD4T does have a module that takes ...
I'm not sure there is a correct answer here... i think it's based on the client needs.
Here's an opinion...
It's now possible to store binaries in the broker database, it makes a great case for managing them in the CMS, so that external 'consumers' (development teams, partner websites, load balanced machines, etc) can consume / store these files and ...
The image uploader in the SDL Tridion Powertools project has an example of uploading / creating binaries using the core service:
FileInfo fileInfo = new FileInfo(file);
string mmType = GetMultiMediaType(fileInfo.Extension);
if (mmType != null)
BinaryContentData bcd = new BinaryContentData
As you probably know by now, the decision to remove a binary is taken by the deployer based on the number of references to that binary. Once the number of references reaches 0, the deployer will remove the binary.
If you have access to the Broker database, you can try to find which items reference a given binary by running a query +/- like this:
select * ...
You may specify any existing SG in your website publication in the AddBinary method. You may not, though, change the path of an existing SG. It's not a property you can set. An image must be associated with an existing structure group. However, you choose what SG you publish a binary to in your TBBs. So what you can do is call the AddBinary method with any ...
Please understand following:
Every time you publish a PDF, SDL Tridion maintains a reference count in the Broker database.
On the other hand, when you un-publish a PDF the reference count is reduced.
Once the reference count hits zero the PDF will be removed from the file system.
Now check even after un-publishing whether it is still available on the file ...
I agree with John that it would be based on the clients needs, but also in relation to what development and deployment model you have chosen.
When looking at the different implementation options, I like the simplicity of having HTML in your (DWT) Templates and then often will go for Publishing CSS and JS as Pages (personally hate the idea of using ...
Here is the logic that I use with clients (and chiming in with what Alvin said):
C# is code, therefore belongs in a code repository (e.g. SVN).
Java is code, therefore belongs is a code repository.
SQL scripts is code, therefore belongs is a code repository.
.... should I go on?
The problem here is that the DD4T LinkFactory class only looks for regular component links. It only queries the link_info broker table, which does not contain links to binaries.
When we had to implement a similar functionality, we had to customize the DD4T code.
What you could do is something like this
create a custom LinkFactory class, inheriting from ...
I think Bart and John did a good job explaining the mechanisms of how to deal with CSS/JS. I want to chime in regarding whether to publish them as binaries or not.
I am a strong believer that you should not store CSS/JS as binaries (i.e. Multimedia Components). I don't think it's the right way. The whole contention point starts with the way these assets are ...
In order to achieve this I suggest reading the API manual, and look for the AddBinary() method. This will allow you to publish the file with a specific filename, and bind it to a Structure Group. You will need to make Structure Groups to match your Folder structure in order to fully achieve what you want.
To create a Multimedia Component you will first need to upload the binary data to the Content Manager, and then you create the Component and set its Multimedia Properties. See my sample code below:
string myFilename = "picture.jpg"; // you can get this from the original component
string extension = myFilename.Substring(myFilename.LastIndexOf('.') + 1);
As you noticed, you can add binaries on the fly with AddBinary, however they always need to be variants of a component (although not necessarily a multimedia component). The reason for this relationship is to ensure that the ad hoc binaries are managed ie, they can also be unpublished (when the related component is unpublished).
The simplest way to manage ...
Based on your question, it looks like you want to publish binaries to a certain location. You can add configuration in the cd_storage_conf on the deployer to deploy the binaries at any given location.
Step 1: add the new storage under "Storages" assuming you have a different default storage for all other content
<Storage Type="filesystem" Class="com....
When you call AddBinary() you are responsible for ensuring that the binary will have a unique location on the content delivery file system. If you are not specifying a structure group, then all your binaries will end up in the folder specified in the Images Path property of your publication. As the editors can upload images with duplicate filenames, this ...
I've managed to figure out the problem. I didn't need to download the file to a specific location I can just use the existing stream item. See code below:
if (compData.BinaryContent != null)
string origFilename = compData.BinaryContent.Filename;
string extension = origFilename.Substring(...
I remember running into a similar issue writing a binary, but my problem was that the stream's position needed to be reset to the start. Perhaps under the hood your issue is along similar lines.
I've also taken a look at a number of TBBs laying around and I see the following code over and over when adding a binary to the package, first writetostream and ...
Considering the fact that you need script and styles all across DTAP (Dev, Test, Acceptance, and Production), JS and CSS files should probably follow the same development processes as application code.
The biggest benefit to placing these in the CMS is the "managed" part, which echoes Mihai's points:
Versions and comparisons
Publishing and ...
If for any reason you require the same image in the CMS to be published with different names (Example: You are resizing the image, create an additional thumbnail version, etc...) is also possible using an overload of the method RenderedItem.AddBinary where you specify a variantid, so there is no conflict between both published files coming from the same ...
The reason that there are two images produced (one per publication) is because they are separate images, even if they are shared components.
At the moment your images are the same (as they are both shared from Publication A), however if you where to localize the image in Publications B and C and upload a new image to each publication the images will now be ...
DD4T comes with an HTTPModule to stream binary content out of your MVC application.
It does not otherwise expose APIs to access binary content stored in Tridion. You could of course just use the Tridion API directly (not the one you mention; that's a CM API; use the .Net CD API):
AFAIK, when you create component links in the RTF field, Tridion does not generates the binary link.
You may refer the Process Download Links in Output extension for this purpose.
This was written for SDL Tridion 2011, but hopefully may work for SDL Tridion 2013 as well.
This is a known issue in DD4T. The root cause is that a non-existing image was requested. When somebody tries to access a non-existing image url (in a non-existing folder), the BinaryFactory creates the new directory first, and puts an empty placeholder file inside it. If the image does not exist in the broker, the factory performs a cleanup by deleting the ...
As Chris mentioned, the addBinary method (from the namespace: Tridion.ContentManager.Publishing.Rendering.RenderedItem) is what you need, here's the options available:
AddBinary(Component); AddBinary(Component, String);
AddBinary(Stream, String, String, Component,String);
Found out the problem and it was a simple one!
Seemed to be an issue with publishing out an older version of the EOT file. Whether this was due to the cache channel service or the component being checked out which sometimes happens I don't know.
Making sure the cache channel was restarted and ensuring all items where checked in fully made sure the item ...