Changeset 618 for trunk/zoo-project/zoo-kernel/service_internal.c
- Timestamp:
- Mar 28, 2015, 12:58:00 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service_internal.c
r607 r618 2788 2788 map *ext=getMap(tmpI->content,"extension"); 2789 2789 char *file_path; 2790 2790 char file_ext[32]; 2791 2791 2792 2792 if( ext != NULL && ext->value != NULL) { 2793 2794 2795 2793 strncpy(file_ext, ext->value, 32); 2794 } 2795 else { 2796 2796 // Obtain default file extension (see mimetypes.h). 2797 2797 // If the MIME type is not recognized, txt is used as the default extension 2798 2798 map* mtype=getMap(tmpI->content,"mimeType"); 2799 2799 getFileExtension(mtype != NULL ? mtype->value : NULL, file_ext, 32); 2800 2800 } 2801 2801 2802 2802 file_name=(char*)malloc((strlen(s->name)+strlen(file_ext)+strlen(tmpI->name)+1024)*sizeof(char)); 2803 2803 int cpid0=cpid+time(NULL); 2804 2804 sprintf(file_name,"%s_%s_%i.%s",s->name,tmpI->name,cpid0,file_ext); 2805 2805 file_path=(char*)malloc((strlen(tmp1->value)+strlen(file_name)+2)*sizeof(char)); 2806 2806 sprintf(file_path,"%s/%s",tmp1->value,file_name);
Note: See TracChangeset
for help on using the changeset viewer.