Urgent: How to set content type on upload depending on target folder?
Hi,
i have to set the content type of a file uploaded via SMB depending on the folder the file is placed in. All files placed below a certain root directory have to be of my custom content type. All others should be stored as documents of type "Document". Is there an easy way to accomplish this task? I can't assume any specific file extensions and can therefore not register my custom content type to that extension.
Any hints are welcome.
Thanks.
Hi,
i have to set the content type of a file uploaded via SMB depending on the folder the file is placed in.All files placed below a certain root directory have to be of my custom content type.
+++ Use an agent to verify the name and extension using the IfsEvent class and EVENTTYPE_CREATEINSTANCE
All others should be stored as documents of type "Document". Is there an easy way to accomplish this task?
+++ Those that aren't your custom content type move to a different folder using the agent.
I can't assume any specific file extensions and can therefore not register my custom content type to that extension.
+++I've found that registering content type only really affects things like how a browser knows what kind of file it's downloading/looking at (mime type) or how a renderer knows how to render it.
Any hints are welcome.
Thanks.
Similar Messages
-
I download itext for convert jsp to PDF. How to set content type for PDF.
I download itext for convert jsp to PDF. How to set content type for PDF. I try
<%@ page contentType = "application/pdf;charset=TIS-620" %>
, but the page does not PDF.
Thank.PDF files are usually binary files, JSPs are not well-suited for binary content.
(If you download the result of your JSP you'll see that it is not a valid PDF file; it will have probably a lot of whitespace and linefeeds, that will choke your PDF reader.). The first few characters must be
"%PDF-" without whitespace.
You can try using PDF files encoded as text - check if you can use text-encoded PDFs in iText.
Try using a Servlet instead. -
How to set content type while sending an email?
Hello,
I want to set content type text/html while send an email using org.apache.commons.httpclient api. I am using MultipartPostMethod method. and i am set using object of multipartpostmethod like post.
and post.setRequestHeader("Content-Type","text/html").
but it wont work.
so please give me a proper solution.
example::
MultipartPostMethod post = new MultipartPostMethod("url");
post.addParameter("msgbody","html message");
post.setRequestHeader("Content-Type","text/html");
Regards,
Bhavesh KharwaActually, I'm writing a "HashMap" from servlet to applet. I have used your suggested content type "application/octet-stream" and another "appication/x-java-serialized-object" to try it. But in applet side, when I use (HashMap)in.readObject(), it always gives me a exception as:"java.util.HashMap; IllegalAccessException". Why?
Thankd. -
How to set content type in servlet?
Hi, there,
I'm writing a servlet to use ObjectOutputStream to return an object to applet. How can I set this content type in servlet?
Thanks.Actually, I'm writing a "HashMap" from servlet to applet. I have used your suggested content type "application/octet-stream" and another "appication/x-java-serialized-object" to try it. But in applet side, when I use (HashMap)in.readObject(), it always gives me a exception as:"java.util.HashMap; IllegalAccessException". Why?
Thankd. -
How to set content-type for outbound mail in BCS
Hey everybody,
can anybody please give me a hint how to set the content-type for outbound email in ABAP using BCS to send mail.
By default the content tyoe is set to text/html. I need other.
Best regards
Roman//add related mutip-part to combine parts
MimeMultipart multipart = new MimeMultipart("related");
//attach a pdf
messageBodyPart = new MimeBodyPart();
fds = new FileDataSource("h:/something.pdf");
messageBodyPart.setDataHandler(new DataHandler(fds));
messageBodyPart.setFileName(fds.getName());
multipart.addBodyPart(messageBodyPart);
//add multipart to the message
message.setContent(multipart);
//send message
Transport.send(message); -
How to set Content-Type of attachment?
Does anyone know how I can set the Content-Type of an attachment of an outgoing mail?
I use Apple Mail, and with one correspondent I have this annoying problem that he never receives any excel or word attachments that I send (and possibly other ones, too).
Our support now says that I should try to set the Content-Type
of the excel attachments to "Content-Type: application/vnd.ms-excel".
Apple Mail seems to set it to
"Content-Type: application/octet-stream"
and they think that attachments with this content-type might get blocked by the mail server of my correspondent.
Any suggestions, ideas, etc., will be appreciated.
Best regards,
Gabriel.Thanks a lot for your test.
Unfortunately, I get
Content-Type: application/octet-stream;
when I try to send an excel attachment to myself.
Below is the beginning of the email (in "source" format).
Any ideas why you get the correct mime-type, but I don't?
Regards,
Gabriel.
---------- beginning of email
Return-Path: <[email protected]>
Received: from [80.128.100.143] (account xxxxxxx HELO [192.168.2.100])
by tu-clausthal.de (CommuniGate Pro SMTP 5.2.4)
with ESMTPSA id 35503032 for [email protected]; Mon, 30 Jun 2008 21:59:05 +0200
Message-Id: <[email protected]>
From: Gabriel Zachmann <[email protected]>
To: Gabriel Zachmann <[email protected]>
Content-Type: multipart/signed; boundary=Apple-Mail-13-325543015; micalg=sha1; protocol="application/pkcs7-signature"
Mime-Version: 1.0 (Apple Message framework v924)
Subject: test
Date: Mon, 30 Jun 2008 21:59:04 +0200
X-Mailer: Apple Mail (2.924)
--Apple-Mail-13-325543015
Content-Type: multipart/mixed;
boundary=Apple-Mail-12-325542957
--Apple-Mail-12-325542957
Content-Disposition: attachment;
filename="Kostenabfrage AVILUS Gesamtinklusive_TPxyz 080606.xls"
Content-Type: application/octet-stream;
x-mac-creator=5843454C;
x-unix-mode=0644;
x-mac-type=584C5338;
name="Gesamt.xls"
Content-Transfer-Encoding: base64 -
How to set content type for a JSF page
Hi,
I want to know is there any way we can specify the content type of a JSF page, like in JSPs we have the page attribute <%@ page contentType="application/vnd.ms-excel" %>
In JSP we can create a html table with values and if we specify the contenType as application/vnd.ms-excel, we would get an excel file generated.
But do we have something similar to this is JSF, as I am using Facelets I cannot use page directive in the xhtml file.
I tried setting the content type in MangedBean's action as follows
((HttpServletResponse)FacesContext.getCurrentInstance().getExternalContext().getResponse()).setContentType("application/vnd.ms-excel"); but it did'nt work.
Thanks in advance.//add related mutip-part to combine parts
MimeMultipart multipart = new MimeMultipart("related");
//attach a pdf
messageBodyPart = new MimeBodyPart();
fds = new FileDataSource("h:/something.pdf");
messageBodyPart.setDataHandler(new DataHandler(fds));
messageBodyPart.setFileName(fds.getName());
multipart.addBodyPart(messageBodyPart);
//add multipart to the message
message.setContent(multipart);
//send message
Transport.send(message); -
How to set content type in SOAP AXIS sender adapter
Hi All,
I am trying to fetch the data from an URL which has special characters(like Ä, ï) using SAP PI - SOAP AXIS adapter. I am facing the below error in the channel.
“error during receive: java.io.UnsupportedEncodingException: charset: utf-8”
I need to set the content type as ISO-9958-1 but there is no such option present in the SOAP AXIS sender Adapter. Please let me know if there is any way to set the content type and fetch the data successfully.
Thanks,
KondaHi Sudha,
I have tried textcodepageconversion, Message
Transformation and Annomizer beans but didn't help and this error is in sender SOAP AXIS adapter.
Thanks,
Konda -
How to set content type for the attachment?
Hello Everybody,
I was trying to do the following in my send mail program:-
1. I am making a file using FileWriter:
FileWriter fw = new FileWriter(f);
fw.write(str);
2. I now want to attach this file with my mail. but before that I want to set the Content type of this as "application/smil". and trying the following code:
mimebodyparts[0].setContent(fds[0],"application/smil");
As this is a new MIME type perhaps I need to change the mailcap file. I found the same in the activation jar package but thought instead of chagning the default file i tried putting following code in my program:
File capfile = new File("simple.mailcap");
if (!capfile.isFile())
System.out.println("Cannot locate the \"simple.mailcap\" file.");
System.exit(1);
CommandMap.setDefaultCommandMap( new MailcapCommandMap(new FileInputStream(capfile)));
and in simple.mailcap file put the following value
application/smil;; x-java-content-handler=com.sun.mail.handlers.application_smil but I am still getting the following error:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/smil
Can somebody Please help to sort this out.
regards,
Arun//add related mutip-part to combine parts
MimeMultipart multipart = new MimeMultipart("related");
//attach a pdf
messageBodyPart = new MimeBodyPart();
fds = new FileDataSource("h:/something.pdf");
messageBodyPart.setDataHandler(new DataHandler(fds));
messageBodyPart.setFileName(fds.getName());
multipart.addBodyPart(messageBodyPart);
//add multipart to the message
message.setContent(multipart);
//send message
Transport.send(message); -
Hi,
I am using velocity model and to set the content type of response as csv report i am setting content type of response as
$response.setContentType("application/vnd.ms-excel")
This stmt opens up open-save download dialog box. But the problem is a new internet browser window also opens up. I want to hide this newly opened browser till i click on open button.
How i can hide or disable this IE window.Ritu,
U specified only content type , try to specifiy attributes like attachment where u can rid of the IE explorer.
if u have any other doubts u r most welcome giving me a mail [email protected]
Thanks.
Sravan -
How to Keep Content Types Current with Updated Data
Let’s say that I have four content types—content type 1, content type 2, content type 3, and content type 4—all based on the same list, say list A.
Each content type has its own workflow.
When the workflow for content type 1 is completed, the data is saved to an individual item, say item Z, in a separate list, list B.
When the workflow for content type 2 is completed, the data is saved to the same item (item Z) in list B. The reason that there are two lists is that the creation of content types causes new items to be created, but the each
new item must reference data from the previous item. That means that data has to be copied from the first item to the second item. But what happens to the data in the second item when data from the first item is changed? The solution is to have a single item
in another list to which all content types write their data.
What I need to know is how can all the content types retrieve data from list B when those content types are based on list A? For example, let's say that content type 3 uses data originally input through content type 1. As the
user inputs and saves data through content type 3 he sees data that had been originally input through content type 1. Another user then accesses content type 1 to update and save data through it. When content type 3 is opened again that user will not see the
updated data entered through content type 1 because it is tied to a different item. The solution seems to be for all content types to save their data to the same item in another list. But then how can those content types be designed so that when they open
they show updated data from List B when those content types are based on List A?
Other applications have the notion of a folder containing all the up-to-date data fields. Another way to look at this problem is to state what SharePoint 2007 does to mimic the notion of a folder.Thanks for responding, but I don't think that the solution provided solves my problem. What you described will keep the item in List B in sync with the changes made to List A. However, the content types from List A will not be in sync when they are opened
from List A. Say content type 1 makes changes to various fields. When content type 3 opens it displays some of the fields that content type 1 changed; however, content type 3 and content type 1 by definition display different items--and those items are not
in sync. Either I have to copy the updated item from List B back to the related items in List A or there has to be another solution.
Is it possible to have a workflow update all the items in a list based on a key field whenever changes are made to that item. Say content types 1, 2, 3, and 4 already exist and each refers to a different item in List A, but they are "tied" together
by a key field. When content type 1 is reopened and changes are made, is it possible to iterate over the items in a list to find other items whose key field matches the key field from content type 1? If so, then when matching items are found the fields in
them can be updated by the same changes made to content type 1.
If this latter scenario is possible, how is that iteration set up in a SharePoint 2007 workflow? Thanks again. -
Document Set Content Type Workflow
I have a document library in Share Point 2013 that is using Document Sets. I need to set up a workflow under the document content type that would send an e-mail if documents have not been uploaded by a specific due date in the document set. Any
Help will be greatly appreciated.Hi,
Based on your description, my understanding is that you want to send an email if there is no document uploaded to the document set by a specific due date in the document set.
I recommend to create retention policy on the document set content type in the library to start the workflow at the due date.
The workflow can be created as the image below:
Firstly, get the max id in the library for using in the loop condition in the workflow:
You can follow the link below for details:
http://social.technet.microsoft.com/Forums/en-US/a8a890b5-f5fb-447f-b96f-9f3abdb7e178/forum-faq-sharepoint-2013-extracting-values-from-a-multivalue-enabled-lookup-column-and-merge?forum=sharepointgeneral
Secondly, we need to loop through the items in the library and then check if there are documents(including folders)
existed inside the document set which is called text for example.
Please change the string “/sites/victoria/lib set/” in the Replace Substring in String step to be the relative URL of your library and make sure that there is a space before the document set name in the if condition in the workflow as the image below shows:
Best regards.
Thanks
Victoria Xia
TechNet Community Support -
How to set field type choice using csom (c#)
I have a field type: Choice (menu to choose from) which is not multichoice. How do I set a value?
I have found code for multiple choice but it doesn't seem to work for single choice.Hi,
The following code snippet for your reference:
newListItem["ChoiceFieldName"] = "ChoiceValue";
newListItem.Update();
clientContext.Load(newListItem);
clientContext.ExecuteQuery();
If you are assigning a Value which is not in the Choice Column, You need to create a choice value then assign it to the item.
More information is here:
http://sharepoint.stackexchange.com/questions/124999/how-to-set-field-type-choice-using-csom-c
Best Regards
Dennis Guo
TechNet Community Support -
How to set Content Set from 'Parallel' to 'Sequential' in Report Manager?
Dear All,
How to set Content Set from 'Parallel' to 'Sequential' in Report Manager?
Thanks,
JackieSorry, Please ignore, thanks...
-
How to setting Content Presenter?
I dont want the message show up when I move the mouse on the link, how to setting Content Presenter?
[https://communities.oracle.com/portal/server.pt/gateway/PTARGS_0_193021_269_216_224_43/http%3B/collaborationrs%3B7005/collab/docman/download/584917/0/0/0/]Hi Yannick,
Going through the links which you have provided and will come back to you I face any problem.
Before going through the link I would like to know how to get content from ucms from specifying a query rather than getting from the entire folder.
Yes I am aware similar to the folder option you can specify a query but need help on writing a query and what parameters need to be mentioned in the query.
One more doumb question about where content presenter taskflow is present in the jdev so that I can drag and drop on my portal page.
Maybe you are looking for
-
Hello, I'm trying to start BW report from MSS without any luck. I created a function code for the report with function type BWR3 in R/3 IMG for Manager's desktop. I Enterd the function code in table T77MWBBWS (the table is not in the IMG !) with : ob
-
How to create a global role with WLST in WL 10
Hi All: The approach in the protect_resources.py found in dev2dev, doesn't work. I've managed to convert the user and group creation to work with WL 10, but I can't for the life of me figure out how to create the role. There doesn't seem to be a crea
-
Why can I not install Presenter v.9
Downloaded and installed eLearning suite 6.1. All components appear to have installed correctly, with the exception of Presenter v.9. The install GUI indicates that there is a previous version installed. However having swept drive, and checked for hi
-
Hello, I have the usual issue to use AcroExch.PDDoc/AcroExch.App/AcroExch.AVDoc objects in Visual Basic (MS EXCEL). On my company's machine I have Acrobat X and everything works fine. I am looking for the cheapest solution to get the stuff running on
-
Phone Randomly Goes Black in iOS7.0.2
Ever since installing the update to 7.0.2, my phone randomly locks up then goes black and unresponsive for a time, no matter what I do to try to restart. After a few minute the phone restarts. The kicker is I though the update to iOS7.0.2 was suppose